#include <AIPathfind.h>
Public Types | |
| enum | { INITIAL_ZONES = 256 } |
| enum | { ZONE_BLOCK_SIZE = 10 } |
| enum | { UNINITIALIZED_ZONE = 0 } |
Public Member Functions | |
| PathfindZoneManager () | |
| ~PathfindZoneManager () | |
| void | reset (void) |
| Bool | needToCalculateZones (void) const |
| Returns true if the zones need to be recalculated. | |
| void | markZonesDirty (Bool insert) |
| Called when the zones need to be recalculated. | |
| void | updateZonesForModify (PathfindCell **map, PathfindLayer layers[], const IRegion2D &structureBounds, const IRegion2D &globalBounds) |
| Called to recalculate an area when a structure has been removed. | |
| void | calculateZones (PathfindCell **map, PathfindLayer layers[], const IRegion2D &bounds) |
| Does zone calculations. | |
| zoneStorageType | getEffectiveZone (LocomotorSurfaceTypeMask acceptableSurfaces, Bool crusher, zoneStorageType zone) const |
| zoneStorageType | getEffectiveTerrainZone (zoneStorageType zone) const |
| zoneStorageType | getNextZone (void) |
| void | getExtent (ICoord2D &extent) const |
| zoneStorageType | getBlockZone (LocomotorSurfaceTypeMask acceptableSurfaces, Bool crusher, Int cellX, Int cellY, PathfindCell **map) const |
| return zone relative the the block zone that this cell resides in. | |
| void | allocateBlocks (const IRegion2D &globalBounds) |
| void | clearPassableFlags (void) |
| Bool | isPassable (Int cellX, Int cellY) const |
| Bool | clipIsPassable (Int cellX, Int cellY) const |
| void | setPassable (Int cellX, Int cellY, Bool passable) |
| void | setAllPassable (void) |
| void | setBridge (Int cellX, Int cellY, Bool bridge) |
| Bool | interactsWithBridge (Int cellX, Int cellY) const |
This class manages the zones in the map. A zone is an area in the map that is one contiguous type of terrain (clear, cliff, water, building). If a unit is in a zone, and wants to move to another location, the destination zone has to be the same, or it can't get there. There are equivalency tables for meta-zones. For example, an amphibious craft can travel through water and clear cells.
Definition at line 499 of file AIPathfind.h.
| anonymous enum |
| Enumerator | |
|---|---|
| UNINITIALIZED_ZONE | |
Definition at line 504 of file AIPathfind.h.
| anonymous enum |
| Enumerator | |
|---|---|
| INITIAL_ZONES | |
Definition at line 502 of file AIPathfind.h.
| anonymous enum |
| Enumerator | |
|---|---|
| ZONE_BLOCK_SIZE | |
Definition at line 503 of file AIPathfind.h.
| PathfindZoneManager::PathfindZoneManager | ( | ) |
Definition at line 2156 of file AIPathfind.cpp.
| PathfindZoneManager::~PathfindZoneManager | ( | ) |
Definition at line 2172 of file AIPathfind.cpp.
| void PathfindZoneManager::allocateBlocks | ( | const IRegion2D & | globalBounds | ) |
Definition at line 2247 of file AIPathfind.cpp.
| void PathfindZoneManager::calculateZones | ( | PathfindCell ** | map, |
| PathfindLayer | layers[], | ||
| const IRegion2D & | bounds ) |
Does zone calculations.
Definition at line 2298 of file AIPathfind.cpp.
| void PathfindZoneManager::clearPassableFlags | ( | void | ) |
Definition at line 2988 of file AIPathfind.cpp.
Definition at line 3052 of file AIPathfind.cpp.
| zoneStorageType PathfindZoneManager::getBlockZone | ( | LocomotorSurfaceTypeMask | acceptableSurfaces, |
| Bool | crusher, | ||
| Int | cellX, | ||
| Int | cellY, | ||
| PathfindCell ** | map ) const |
return zone relative the the block zone that this cell resides in.
Definition at line 3109 of file AIPathfind.cpp.
| zoneStorageType PathfindZoneManager::getEffectiveTerrainZone | ( | zoneStorageType | zone | ) | const |
Definition at line 3134 of file AIPathfind.cpp.
| zoneStorageType PathfindZoneManager::getEffectiveZone | ( | LocomotorSurfaceTypeMask | acceptableSurfaces, |
| Bool | crusher, | ||
| zoneStorageType | zone ) const |
Definition at line 3142 of file AIPathfind.cpp.
|
inline |
Definition at line 520 of file AIPathfind.h.
| zoneStorageType PathfindZoneManager::getNextZone | ( | void | ) |
Definition at line 3089 of file AIPathfind.cpp.
Definition at line 3033 of file AIPathfind.cpp.
| void PathfindZoneManager::markZonesDirty | ( | Bool | insert | ) |
Called when the zones need to be recalculated.
| insert | Called when the zones need to be recalculated. |
Definition at line 2269 of file AIPathfind.cpp.
|
inline |
Returns true if the zones need to be recalculated.
Definition at line 511 of file AIPathfind.h.
| void PathfindZoneManager::reset | ( | void | ) |
Definition at line 2262 of file AIPathfind.cpp.
| void PathfindZoneManager::setAllPassable | ( | void | ) |
Definition at line 3001 of file AIPathfind.cpp.
Definition at line 3069 of file AIPathfind.cpp.
Definition at line 3014 of file AIPathfind.cpp.
| void PathfindZoneManager::updateZonesForModify | ( | PathfindCell ** | map, |
| PathfindLayer | layers[], | ||
| const IRegion2D & | structureBounds, | ||
| const IRegion2D & | globalBounds ) |
Called to recalculate an area when a structure has been removed.
Update zones where a structure has been added or removed. This can be done by just updating the equivalency arrays, without rezoning the map..
Definition at line 2837 of file AIPathfind.cpp.