载入中...
搜索中...
未找到
Path.h
浏览该文件的文档.
1#pragma once
2
3#include <vector>
4
5namespace eve::map {
6
8class Path {
9public:
11 void clear();
13 void add(int x, int y);
15 void reverse();
16
18 int getLength() const;
20 int getX(int index) const;
21 int getY(int index) const;
23 float getTotalCost() const;
24 void setTotalCost(float cost);
25
27 bool empty() const { return cells_.empty(); }
28
30 struct Cell {
31 int x = 0;
32 int y = 0;
33 };
34
36 const std::vector<Cell> &cells() const { return cells_; }
37
38private:
39 std::vector<Cell> cells_;
40 float totalCost_ = 0.f;
41};
42
43} // namespace eve::map
int y
Definition Grass.cpp:135
int x
Definition Grass.cpp:135
std::vector< float > cost
Ordered tile-index waypoints from start to goal (inclusive).
Definition Path.h:8
void clear()
Clears all waypoints and cost.
void setTotalCost(float cost)
float getTotalCost() const
Total path cost (A* heuristic + movement cost).
void reverse()
Reverses the waypoint order.
const std::vector< Cell > & cells() const
Raw waypoint vector.
Definition Path.h:36
void add(int x, int y)
Appends a waypoint tile.
bool empty() const
True when there are no waypoints.
Definition Path.h:27
int getY(int index) const
int getLength() const
Number of waypoints (0 = empty/unreachable).
int getX(int index) const
Waypoint tile coordinates.
放置世界:格子占用(多通道)+ 地形语义 + 已放置建筑实例。 行为由 PlacementSystem 提供;本类暴露便于脚本绑定的薄封装方法。 坐标换算统一走 eve::grid(支持 rectang...
One waypoint.
Definition Path.h:30