#include <AIPathfind.h>
Public Types | |
| enum | CellType { CELL_CLEAR = 0x00 , CELL_WATER = 0x01 , CELL_CLIFF = 0x02 , CELL_RUBBLE = 0x03 , CELL_OBSTACLE = 0x04 , CELL_BRIDGE_IMPASSABLE = 0x05 , CELL_IMPASSABLE = 0x06 } |
| enum | CellFlags { NO_UNITS = 0x00 , UNIT_GOAL = 0x01 , UNIT_PRESENT_MOVING = 0x02 , UNIT_PRESENT_FIXED = 0x03 , UNIT_GOAL_OTHER_MOVING = 0x05 } |
Public Member Functions | |
| void | reset () |
| reset the cell | |
| PathfindCell (void) | |
| ~PathfindCell (void) | |
| Bool | setTypeAsObstacle (Object *obstacle, Bool isFence, const ICoord2D &pos) |
| flag this cell as an obstacle, from the given one | |
| Bool | removeObstacle (Object *obstacle) |
| unflag this cell as an obstacle, from the given one | |
| void | setType (CellType type) |
| set the cell type | |
| CellType | getType (void) const |
| get the cell type | |
| CellFlags | getFlags (void) const |
| get the cell type | |
| Bool | isAircraftGoal (void) const |
| Bool | isObstaclePresent (ObjectID objID) const |
| return true if the given object ID is registered as an obstacle in this cell | |
| Bool | isObstacleTransparent () const |
| return true if the obstacle in the cell is KINDOF_CAN_SEE_THROUGHT_STRUCTURE | |
| Bool | isObstacleFence (void) const |
| return true if the given obstacle in the cell is a fence. | |
| UnsignedInt | costToGoal (PathfindCell *goal) |
| Return estimated cost from given cell to reach goal cell. | |
| UnsignedInt | costToHierGoal (PathfindCell *goal) |
| UnsignedInt | costSoFar (PathfindCell *parent) |
| PathfindCell * | putOnSortedOpenList (PathfindCell *list) |
| put self on "open" list in ascending cost order, return new list | |
| PathfindCell * | removeFromOpenList (PathfindCell *list) |
| remove self from "open" list | |
| PathfindCell * | putOnClosedList (PathfindCell *list) |
| put self on "closed" list, return new list | |
| PathfindCell * | removeFromClosedList (PathfindCell *list) |
| remove self from "closed" list | |
| PathfindCell * | getNextOpen (void) |
| UnsignedShort | getXIndex (void) const |
| UnsignedShort | getYIndex (void) const |
| Bool | isBlockedByAlly (void) const |
| void | setBlockedByAlly (Bool blocked) |
| Bool | getOpen (void) const |
| Bool | getClosed (void) const |
| UnsignedInt | getCostSoFar (void) const |
| UnsignedInt | getTotalCost (void) const |
| void | setCostSoFar (UnsignedInt cost) |
| void | setTotalCost (UnsignedInt cost) |
| void | setParentCell (PathfindCell *parent) |
| void | clearParentCell (void) |
| void | setParentCellHierarchical (PathfindCell *parent) |
| PathfindCell * | getParentCell (void) const |
| Bool | startPathfind (PathfindCell *goalCell) |
| Bool | getPinched (void) const |
| void | setPinched (Bool pinch) |
| Bool | allocateInfo (const ICoord2D &pos) |
| void | releaseInfo (void) |
| Bool | hasInfo (void) const |
| zoneStorageType | getZone (void) const |
| void | setZone (zoneStorageType zone) |
| void | setGoalUnit (ObjectID unit, const ICoord2D &pos) |
| void | setGoalAircraft (ObjectID unit, const ICoord2D &pos) |
| void | setPosUnit (ObjectID unit, const ICoord2D &pos) |
| ObjectID | getGoalUnit (void) const |
| ObjectID | getGoalAircraft (void) const |
| ObjectID | getPosUnit (void) const |
| ObjectID | getObstacleID (void) const |
| void | setLayer (PathfindLayerEnum layer) |
| set the cell layer | |
| PathfindLayerEnum | getLayer (void) const |
| get the cell layer | |
| void | setConnectLayer (PathfindLayerEnum layer) |
| set the cell layer connect id | |
| PathfindLayerEnum | getConnectLayer (void) const |
| get the cell layer connect id | |
Static Public Member Functions | |
| static Int | releaseClosedList (PathfindCell *list) |
| remove all cells from closed list. | |
| static Int | releaseOpenList (PathfindCell *list) |
| remove all cells from closed list. | |
This represents one cell in the pathfinding grid. These cells categorize the world into idealized cellular states, and are also used for efficient A* pathfinding.
Definition at line 253 of file AIPathfind.h.
Definition at line 268 of file AIPathfind.h.
Definition at line 257 of file AIPathfind.h.
| PathfindCell::PathfindCell | ( | void | ) |
Constructor
Definition at line 1192 of file AIPathfind.cpp.
| PathfindCell::~PathfindCell | ( | void | ) |
Destructor
Definition at line 1200 of file AIPathfind.cpp.
Allocates an info record for a cell.
Definition at line 1285 of file AIPathfind.cpp.
| void PathfindCell::clearParentCell | ( | void | ) |
Reset the parent cell.
Definition at line 1275 of file AIPathfind.cpp.
| UnsignedInt PathfindCell::costSoFar | ( | PathfindCell * | parent | ) |
Definition at line 1715 of file AIPathfind.cpp.
| UnsignedInt PathfindCell::costToGoal | ( | PathfindCell * | goal | ) |
Return estimated cost from given cell to reach goal cell.
Definition at line 1678 of file AIPathfind.cpp.
| UnsignedInt PathfindCell::costToHierGoal | ( | PathfindCell * | goal | ) |
Definition at line 1702 of file AIPathfind.cpp.
|
inline |
Definition at line 330 of file AIPathfind.h.
|
inline |
get the cell layer connect id
Definition at line 364 of file AIPathfind.h.
|
inline |
Definition at line 331 of file AIPathfind.h.
|
inline |
get the cell type
Definition at line 287 of file AIPathfind.h.
|
inline |
Definition at line 355 of file AIPathfind.h.
|
inline |
Definition at line 354 of file AIPathfind.h.
|
inline |
get the cell layer
Definition at line 361 of file AIPathfind.h.
|
inline |
Definition at line 321 of file AIPathfind.h.
|
inline |
Definition at line 358 of file AIPathfind.h.
|
inline |
Definition at line 329 of file AIPathfind.h.
|
inline |
Definition at line 340 of file AIPathfind.h.
|
inline |
Definition at line 343 of file AIPathfind.h.
|
inline |
Definition at line 356 of file AIPathfind.h.
|
inline |
Definition at line 332 of file AIPathfind.h.
|
inline |
get the cell type
Definition at line 286 of file AIPathfind.h.
|
inline |
Definition at line 323 of file AIPathfind.h.
|
inline |
Definition at line 324 of file AIPathfind.h.
|
inline |
Definition at line 349 of file AIPathfind.h.
|
inline |
Definition at line 348 of file AIPathfind.h.
|
inline |
Definition at line 288 of file AIPathfind.h.
|
inline |
Definition at line 326 of file AIPathfind.h.
|
inline |
return true if the given obstacle in the cell is a fence.
Definition at line 294 of file AIPathfind.h.
return true if the given object ID is registered as an obstacle in this cell
Return true if the given object ID is registered as an obstacle in this cell
Definition at line 973 of file AIPathfind.h.
|
inline |
return true if the obstacle in the cell is KINDOF_CAN_SEE_THROUGHT_STRUCTURE
Definition at line 292 of file AIPathfind.h.
| PathfindCell * PathfindCell::putOnClosedList | ( | PathfindCell * | list | ) |
put self on "closed" list, return new list
Definition at line 1632 of file AIPathfind.cpp.
| PathfindCell * PathfindCell::putOnSortedOpenList | ( | PathfindCell * | list | ) |
put self on "open" list in ascending cost order, return new list
Definition at line 1511 of file AIPathfind.cpp.
|
static |
remove all cells from closed list.
remove all cells from "closed" list
Definition at line 1608 of file AIPathfind.cpp.
| void PathfindCell::releaseInfo | ( | void | ) |
Releases an info record for a cell.
Definition at line 1297 of file AIPathfind.cpp.
|
static |
remove all cells from closed list.
remove all cells from "open" list
Definition at line 1584 of file AIPathfind.cpp.
| PathfindCell * PathfindCell::removeFromClosedList | ( | PathfindCell * | list | ) |
remove self from "closed" list
Definition at line 1654 of file AIPathfind.cpp.
| PathfindCell * PathfindCell::removeFromOpenList | ( | PathfindCell * | list | ) |
remove self from "open" list
Definition at line 1564 of file AIPathfind.cpp.
unflag this cell as an obstacle, from the given one
Unflag this cell as an obstacle, from the given one. Return true if this cell was previously flagged as an obstacle by this object.
Definition at line 1497 of file AIPathfind.cpp.
| void PathfindCell::reset | ( | ) |
|
inline |
Definition at line 327 of file AIPathfind.h.
|
inline |
set the cell layer connect id
Definition at line 363 of file AIPathfind.h.
|
inline |
Definition at line 334 of file AIPathfind.h.
Sets the goal aircraft into the info record for a cell.
Definition at line 1368 of file AIPathfind.cpp.
Sets the goal unit into the info record for a cell.
Definition at line 1326 of file AIPathfind.cpp.
|
inline |
set the cell layer
Definition at line 360 of file AIPathfind.h.
| void PathfindCell::setParentCell | ( | PathfindCell * | parent | ) |
Set the parent pointer.
Definition at line 1252 of file AIPathfind.cpp.
| void PathfindCell::setParentCellHierarchical | ( | PathfindCell * | parent | ) |
Set the parent pointer.
Definition at line 1266 of file AIPathfind.cpp.
|
inline |
Definition at line 344 of file AIPathfind.h.
Sets the position unit into the info record for a cell.
Definition at line 1398 of file AIPathfind.cpp.
|
inline |
Definition at line 335 of file AIPathfind.h.
| void PathfindCell::setType | ( | CellType | type | ) |
flag this cell as an obstacle, from the given one
Flag this cell as an obstacle, from the given one. Return true if cell was flagged.
Definition at line 1445 of file AIPathfind.cpp.
|
inline |
Definition at line 350 of file AIPathfind.h.
| Bool PathfindCell::startPathfind | ( | PathfindCell * | goalCell | ) |
Reset the pathfinding values in the cell.
Definition at line 1234 of file AIPathfind.cpp.