ScummVM API documentation
Crab::PathfindingAgent Class Reference

Public Member Functions

void setNodeBufferDistance (float w)
 
float getNodeBufferDistance ()
 
double distSquared (PathfindingGraphNode *tileA, PathfindingGraphNode *tileB)
 
double distExact (PathfindingGraphNode *tileA, PathfindingGraphNode *tileB)
 
void initialize (PathfindingGrid *g)
 Sets the tile map. More...
 
void setDestination (Vector2f d)
 
void setDestination (Vector2f d, bool r)
 
void setDestination (Vector2i d)
 
void setDestination (Vector2i d, bool r)
 
void setPosition (Vector2f p)
 
void setPrevPosition (Vector2f p)
 
Vector2f getPosition ()
 
bool positionChanged ()
 
Vector2i getImmediateDest ()
 
void update (uint32 timeslice)
 Performs the main part of the algorithm until the specified time has elapsed or no nodes are left open.
 
bool isDone () const
 Returns true if and only if no nodes are left open. More...
 
Common::Array< PathfindingGraphNode const * > const getSolution (PathfindingGraphNode *destNode) const
 Returns an unmodifiable view of the solution path found by this algorithm.
 
Common::Array< PathfindingGraphNode const * > const getPrunedSolution (PathfindingGraphNode *destNode)
 
void reset ()
 Resets the algorithm.
 
void shutdown ()
 Uninitializes the algorithm before the tile map is unloaded.
 
bool adjacentToGoal (PathfindingGraphNode *node)
 

Public Attributes

PathfindingGrid_grid
 
Vector2f _destination
 
PathfindingGraphNode_startTile
 
PathfindingGraphNode_goalTile
 
PathfindingGraphNode_clickedTile
 
bool _solutionFound
 
bool _noSolution
 
Common::Array< PathfindingGraphNode const * > _vSolution
 
PriorityQueue< PlannerNode_nodeQueue
 
Common::StableMap< PathfindingGraphNode *, PlannerNode * > _createdList
 

Member Function Documentation

◆ initialize()

void Crab::PathfindingAgent::initialize ( PathfindingGrid g)

Sets the tile map.

Invoked when the user opens a tile map file.

Parameters
_tileMapthe data structure that this algorithm will use to access each tile's location and weight data.

◆ isDone()

bool Crab::PathfindingAgent::isDone ( ) const

Returns true if and only if no nodes are left open.

Returns
true if no nodes are left open, false otherwise.

The documentation for this class was generated from the following file: