mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 19:03:43 +00:00
26 lines
941 B
C++
26 lines
941 B
C++
#pragma once
|
|
|
|
#include <optional>
|
|
class PathfinderMob;
|
|
|
|
class RandomPos {
|
|
private:
|
|
static Vec3 tempDir;
|
|
|
|
public:
|
|
static std::optional<Vec3> getPos(std::shared_ptr<PathfinderMob> mob,
|
|
int xzDist, int yDist,
|
|
int quadrant = -1); // 4J added quadrant
|
|
static std::optional<Vec3> getPosTowards(std::shared_ptr<PathfinderMob> mob,
|
|
int xzDist, int yDist,
|
|
Vec3* towardsPos);
|
|
static std::optional<Vec3> getPosAvoid(std::shared_ptr<PathfinderMob> mob,
|
|
int xzDist, int yDist,
|
|
Vec3* avoidPos);
|
|
|
|
private:
|
|
static std::optional<Vec3> generateRandomPos(
|
|
std::shared_ptr<PathfinderMob> mob, int xzDist, int yDist, Vec3* dir,
|
|
int quadrant = -1); // 4J added quadrant
|
|
};
|