Pathfinding facade. Single-agent: A*. Group (same goal): Flow Field + follow. Grid/topology internals stay out of the public ABI (Windows export limit). 更多...
#include <Pathfinder.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| Pathfinder () | |
| Pathfinder (TileLayer *layer) | |
| Pathfinder (int width, int height) | |
| ~Pathfinder () | |
| Pathfinder (Pathfinder &&) noexcept | |
| Pathfinder & | operator= (Pathfinder &&) noexcept |
| Pathfinder (const Pathfinder &)=delete | |
| Pathfinder & | operator= (const Pathfinder &)=delete |
| void | bindLayer (TileLayer *layer) |
| void | setSize (int width, int height) |
| void | setTopology (const std::string &name) |
| std::string | getTopology () const |
| void | setDiagonal (bool enable) |
| bool | getDiagonal () const |
| void | blockGid (int gid) |
| void | unblockGid (int gid) |
| void | clearBlockedGids () |
| void | setBlockEmpty (bool enable) |
| bool | getBlockEmpty () const |
| void | setBlocked (int x, int y, bool blocked) |
| bool | isWalkable (int x, int y) const |
| void | setCellCost (int x, int y, float cost) |
| float | getCellCost (int x, int y) const |
| void | syncFromLayer () |
| Path * | findPath (int sx, int sy, int gx, int gy) |
| A* from (sx,sy) to (gx,gy). Returns owned Path* (may be empty if unreachable). Never returns nullptr — always a Path object for simpler script null checks via length. | |
| FlowField * | buildFlowField (int gx, int gy) |
| Build / reuse cached flow field toward goal. Owned by caller. | |
| Path * | followFlow (FlowField *field, int sx, int sy) |
| Path * | findGroupPath (int sx, int sy, int gx, int gy) |
| Group helper: ensure field for goal, then follow from start. Equivalent to buildFlowField + followFlow but reuses internal cache when possible. | |
| void | invalidateCache () |
| Invalidate cached flow field (also called when grid dirties). | |
详细描述
Pathfinding facade. Single-agent: A*. Group (same goal): Flow Field + follow. Grid/topology internals stay out of the public ABI (Windows export limit).
在文件 Pathfinder.h 第 17 行定义.
构造及析构函数说明
◆ Pathfinder() [1/5]
| eve::map::Pathfinder::Pathfinder | ( | ) |
在文件 Pathfinder.cpp 第 304 行定义.
◆ Pathfinder() [2/5]
|
explicit |
在文件 Pathfinder.cpp 第 306 行定义.
引用了 bindLayer() , 以及 layer.
◆ Pathfinder() [3/5]
|
explicit |
在文件 Pathfinder.cpp 第 308 行定义.
◆ ~Pathfinder()
|
default |
◆ Pathfinder() [4/5]
|
defaultnoexcept |
◆ Pathfinder() [5/5]
|
delete |
成员函数说明
◆ bindLayer()
| void eve::map::Pathfinder::bindLayer | ( | TileLayer * | layer | ) |
◆ blockGid()
| void eve::map::Pathfinder::blockGid | ( | int | gid | ) |
在文件 Pathfinder.cpp 第 339 行定义.
引用了 invalidateCache().
◆ buildFlowField()
| FlowField * eve::map::Pathfinder::buildFlowField | ( | int | gx, |
| int | gy | ||
| ) |
Build / reuse cached flow field toward goal. Owned by caller.
在文件 Pathfinder.cpp 第 507 行定义.
◆ clearBlockedGids()
| void eve::map::Pathfinder::clearBlockedGids | ( | ) |
在文件 Pathfinder.cpp 第 349 行定义.
引用了 invalidateCache().
◆ findGroupPath()
| Path * eve::map::Pathfinder::findGroupPath | ( | int | sx, |
| int | sy, | ||
| int | gx, | ||
| int | gy | ||
| ) |
Group helper: ensure field for goal, then follow from start. Equivalent to buildFlowField + followFlow but reuses internal cache when possible.
在文件 Pathfinder.cpp 第 567 行定义.
◆ findPath()
| Path * eve::map::Pathfinder::findPath | ( | int | sx, |
| int | sy, | ||
| int | gx, | ||
| int | gy | ||
| ) |
◆ followFlow()
Trace path along a flow field from start. Owned Path*.
在文件 Pathfinder.cpp 第 533 行定义.
引用了 eve::map::FlowField::costAt(), eve::map::FlowField::getGoalX(), eve::map::FlowField::getGoalY(), eve::map::FlowField::isReachable(), eve::map::FlowField::nextX(), eve::map::FlowField::nextY(), step, x , 以及 y.
◆ getBlockEmpty()
| bool eve::map::Pathfinder::getBlockEmpty | ( | ) | const |
在文件 Pathfinder.cpp 第 359 行定义.
◆ getCellCost()
| float eve::map::Pathfinder::getCellCost | ( | int | x, |
| int | y | ||
| ) | const |
在文件 Pathfinder.cpp 第 373 行定义.
◆ getDiagonal()
| bool eve::map::Pathfinder::getDiagonal | ( | ) | const |
在文件 Pathfinder.cpp 第 337 行定义.
◆ getTopology()
| std::string eve::map::Pathfinder::getTopology | ( | ) | const |
在文件 Pathfinder.cpp 第 330 行定义.
◆ invalidateCache()
| void eve::map::Pathfinder::invalidateCache | ( | ) |
Invalidate cached flow field (also called when grid dirties).
在文件 Pathfinder.cpp 第 380 行定义.
被这些函数引用 blockGid(), clearBlockedGids(), setBlocked(), setBlockEmpty(), setCellCost(), setDiagonal(), setSize(), setTopology(), syncFromLayer() , 以及 unblockGid().
◆ isWalkable()
| bool eve::map::Pathfinder::isWalkable | ( | int | x, |
| int | y | ||
| ) | const |
在文件 Pathfinder.cpp 第 366 行定义.
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
defaultnoexcept |
◆ setBlocked()
| void eve::map::Pathfinder::setBlocked | ( | int | x, |
| int | y, | ||
| bool | blocked | ||
| ) |
在文件 Pathfinder.cpp 第 361 行定义.
引用了 invalidateCache(), x , 以及 y.
◆ setBlockEmpty()
| void eve::map::Pathfinder::setBlockEmpty | ( | bool | enable | ) |
在文件 Pathfinder.cpp 第 354 行定义.
引用了 invalidateCache().
◆ setCellCost()
| void eve::map::Pathfinder::setCellCost | ( | int | x, |
| int | y, | ||
| float | cost | ||
| ) |
在文件 Pathfinder.cpp 第 368 行定义.
引用了 cost, invalidateCache(), x , 以及 y.
◆ setDiagonal()
| void eve::map::Pathfinder::setDiagonal | ( | bool | enable | ) |
在文件 Pathfinder.cpp 第 332 行定义.
引用了 invalidateCache().
◆ setSize()
| void eve::map::Pathfinder::setSize | ( | int | width, |
| int | height | ||
| ) |
◆ setTopology()
| void eve::map::Pathfinder::setTopology | ( | const std::string & | name | ) |
在文件 Pathfinder.cpp 第 325 行定义.
引用了 invalidateCache() , 以及 name.
◆ syncFromLayer()
| void eve::map::Pathfinder::syncFromLayer | ( | ) |
在文件 Pathfinder.cpp 第 375 行定义.
引用了 invalidateCache().
◆ unblockGid()
| void eve::map::Pathfinder::unblockGid | ( | int | gid | ) |
在文件 Pathfinder.cpp 第 344 行定义.
引用了 invalidateCache().
该类的文档由以下文件生成:
- src/modules/map/Pathfinder.h
- src/modules/map/Pathfinder.cpp