载入中...
搜索中...
未找到
eve::map::Pathfinder类 参考

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
 
Pathfinderoperator= (Pathfinder &&) noexcept
 
 Pathfinder (const Pathfinder &)=delete
 
Pathfinderoperator= (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 ()
 
PathfindPath (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.
 
FlowFieldbuildFlowField (int gx, int gy)
 Build / reuse cached flow field toward goal. Owned by caller.
 
PathfollowFlow (FlowField *field, int sx, int sy)
 
PathfindGroupPath (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.h17 行定义.

构造及析构函数说明

◆ Pathfinder() [1/5]

eve::map::Pathfinder::Pathfinder ( )

在文件 Pathfinder.cpp304 行定义.

◆ Pathfinder() [2/5]

eve::map::Pathfinder::Pathfinder ( TileLayer layer)
explicit

在文件 Pathfinder.cpp306 行定义.

引用了 bindLayer() , 以及 layer.

◆ Pathfinder() [3/5]

eve::map::Pathfinder::Pathfinder ( int  width,
int  height 
)
explicit

在文件 Pathfinder.cpp308 行定义.

引用了 height, setSize() , 以及 width.

◆ ~Pathfinder()

eve::map::Pathfinder::~Pathfinder ( )
default

◆ Pathfinder() [4/5]

eve::map::Pathfinder::Pathfinder ( Pathfinder &&  )
defaultnoexcept

◆ Pathfinder() [5/5]

eve::map::Pathfinder::Pathfinder ( const Pathfinder )
delete

成员函数说明

◆ bindLayer()

void eve::map::Pathfinder::bindLayer ( TileLayer layer)

在文件 Pathfinder.cpp314 行定义.

引用了 bindLayer() , 以及 layer.

被这些函数引用 bindLayer() , 以及 Pathfinder().

◆ blockGid()

void eve::map::Pathfinder::blockGid ( int  gid)

在文件 Pathfinder.cpp339 行定义.

引用了 invalidateCache().

◆ buildFlowField()

FlowField * eve::map::Pathfinder::buildFlowField ( int  gx,
int  gy 
)

Build / reuse cached flow field toward goal. Owned by caller.

在文件 Pathfinder.cpp507 行定义.

◆ clearBlockedGids()

void eve::map::Pathfinder::clearBlockedGids ( )

在文件 Pathfinder.cpp349 行定义.

引用了 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.cpp567 行定义.

◆ findPath()

Path * eve::map::Pathfinder::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.

在文件 Pathfinder.cpp446 行定义.

引用了 cx, cy, idx, n, parent, w, x , 以及 y.

◆ followFlow()

Path * eve::map::Pathfinder::followFlow ( FlowField field,
int  sx,
int  sy 
)

◆ getBlockEmpty()

bool eve::map::Pathfinder::getBlockEmpty ( ) const

在文件 Pathfinder.cpp359 行定义.

◆ getCellCost()

float eve::map::Pathfinder::getCellCost ( int  x,
int  y 
) const

在文件 Pathfinder.cpp373 行定义.

引用了 x , 以及 y.

◆ getDiagonal()

bool eve::map::Pathfinder::getDiagonal ( ) const

在文件 Pathfinder.cpp337 行定义.

◆ getTopology()

std::string eve::map::Pathfinder::getTopology ( ) const

在文件 Pathfinder.cpp330 行定义.

◆ invalidateCache()

void eve::map::Pathfinder::invalidateCache ( )

Invalidate cached flow field (also called when grid dirties).

在文件 Pathfinder.cpp380 行定义.

被这些函数引用 blockGid(), clearBlockedGids(), setBlocked(), setBlockEmpty(), setCellCost(), setDiagonal(), setSize(), setTopology(), syncFromLayer() , 以及 unblockGid().

◆ isWalkable()

bool eve::map::Pathfinder::isWalkable ( int  x,
int  y 
) const

在文件 Pathfinder.cpp366 行定义.

引用了 x , 以及 y.

◆ operator=() [1/2]

Pathfinder & eve::map::Pathfinder::operator= ( const Pathfinder )
delete

◆ operator=() [2/2]

Pathfinder & eve::map::Pathfinder::operator= ( Pathfinder &&  )
defaultnoexcept

◆ setBlocked()

void eve::map::Pathfinder::setBlocked ( int  x,
int  y,
bool  blocked 
)

在文件 Pathfinder.cpp361 行定义.

引用了 invalidateCache(), x , 以及 y.

◆ setBlockEmpty()

void eve::map::Pathfinder::setBlockEmpty ( bool  enable)

在文件 Pathfinder.cpp354 行定义.

引用了 invalidateCache().

◆ setCellCost()

void eve::map::Pathfinder::setCellCost ( int  x,
int  y,
float  cost 
)

在文件 Pathfinder.cpp368 行定义.

引用了 cost, invalidateCache(), x , 以及 y.

◆ setDiagonal()

void eve::map::Pathfinder::setDiagonal ( bool  enable)

在文件 Pathfinder.cpp332 行定义.

引用了 invalidateCache().

◆ setSize()

void eve::map::Pathfinder::setSize ( int  width,
int  height 
)

在文件 Pathfinder.cpp319 行定义.

引用了 height, invalidateCache() , 以及 width.

被这些函数引用 Pathfinder().

◆ setTopology()

void eve::map::Pathfinder::setTopology ( const std::string &  name)

在文件 Pathfinder.cpp325 行定义.

引用了 invalidateCache() , 以及 name.

◆ syncFromLayer()

void eve::map::Pathfinder::syncFromLayer ( )

在文件 Pathfinder.cpp375 行定义.

引用了 invalidateCache().

◆ unblockGid()

void eve::map::Pathfinder::unblockGid ( int  gid)

在文件 Pathfinder.cpp344 行定义.

引用了 invalidateCache().


该类的文档由以下文件生成: