17 static constexpr float kUnreachable = std::numeric_limits<float>::infinity();
33 void setGoal(
int x,
int y);
36 float costAt(
int x,
int y)
const;
38 void setCost(
int x,
int y,
float cost);
41 int nextX(
int x,
int y)
const;
43 int nextY(
int x,
int y)
const;
45 void setNext(
int x,
int y,
int nx,
int ny);
48 bool isReachable(
int x,
int y)
const;
51 bool inBounds(
int x,
int y)
const;
52 int index(
int x,
int y)
const {
return y * width_ +
x; }
58 std::vector<float> cost_;
59 std::vector<int> nextX_;
60 std::vector<int> nextY_;
eve::resource::CostSpec cost
#define EVENGINE_API_WORLD
Integration + direction field for group pathfinding to a single goal. nextX/nextY point to the neighb...
int getGoalX() const
Returns the goal x.
int getWidth() const
Returns the width.
int getGoalY() const
Returns the goal y.
int getHeight() const
Returns the height.
放置世界:格子占用(多通道)+ 地形语义 + 已放置建筑实例。 行为由 PlacementSystem 提供;本类暴露便于脚本绑定的薄封装方法。 坐标换算统一走 eve::grid(支持 rectang...