Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
PathfindZoneManager Class Reference

#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
 

Detailed Description

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
UNINITIALIZED_ZONE 

Definition at line 504 of file AIPathfind.h.

◆ anonymous enum

anonymous enum
Enumerator
INITIAL_ZONES 

Definition at line 502 of file AIPathfind.h.

◆ anonymous enum

anonymous enum
Enumerator
ZONE_BLOCK_SIZE 

Definition at line 503 of file AIPathfind.h.

Constructor & Destructor Documentation

◆ PathfindZoneManager()

PathfindZoneManager::PathfindZoneManager ( )

Definition at line 2156 of file AIPathfind.cpp.

◆ ~PathfindZoneManager()

PathfindZoneManager::~PathfindZoneManager ( )

Definition at line 2172 of file AIPathfind.cpp.

Member Function Documentation

◆ allocateBlocks()

void PathfindZoneManager::allocateBlocks ( const IRegion2D & globalBounds)

Definition at line 2247 of file AIPathfind.cpp.

◆ calculateZones()

void PathfindZoneManager::calculateZones ( PathfindCell ** map,
PathfindLayer layers[],
const IRegion2D & bounds )

Does zone calculations.

Definition at line 2298 of file AIPathfind.cpp.

◆ clearPassableFlags()

void PathfindZoneManager::clearPassableFlags ( void )

Definition at line 2988 of file AIPathfind.cpp.

◆ clipIsPassable()

Bool PathfindZoneManager::clipIsPassable ( Int cellX,
Int cellY ) const

Definition at line 3052 of file AIPathfind.cpp.

◆ getBlockZone()

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.

◆ getEffectiveTerrainZone()

zoneStorageType PathfindZoneManager::getEffectiveTerrainZone ( zoneStorageType zone) const

Definition at line 3134 of file AIPathfind.cpp.

◆ getEffectiveZone()

zoneStorageType PathfindZoneManager::getEffectiveZone ( LocomotorSurfaceTypeMask acceptableSurfaces,
Bool crusher,
zoneStorageType zone ) const

Definition at line 3142 of file AIPathfind.cpp.

◆ getExtent()

void PathfindZoneManager::getExtent ( ICoord2D & extent) const
inline

Definition at line 520 of file AIPathfind.h.

◆ getNextZone()

zoneStorageType PathfindZoneManager::getNextZone ( void )

◆ interactsWithBridge()

Bool PathfindZoneManager::interactsWithBridge ( Int cellX,
Int cellY ) const

Definition at line 3089 of file AIPathfind.cpp.

◆ isPassable()

Bool PathfindZoneManager::isPassable ( Int cellX,
Int cellY ) const

Definition at line 3033 of file AIPathfind.cpp.

◆ markZonesDirty()

void PathfindZoneManager::markZonesDirty ( Bool insert)

Called when the zones need to be recalculated.

Parameters
insertCalled when the zones need to be recalculated.

Definition at line 2269 of file AIPathfind.cpp.

◆ needToCalculateZones()

Bool PathfindZoneManager::needToCalculateZones ( void ) const
inline

Returns true if the zones need to be recalculated.

Definition at line 511 of file AIPathfind.h.

◆ reset()

void PathfindZoneManager::reset ( void )

Definition at line 2262 of file AIPathfind.cpp.

◆ setAllPassable()

void PathfindZoneManager::setAllPassable ( void )

Definition at line 3001 of file AIPathfind.cpp.

◆ setBridge()

void PathfindZoneManager::setBridge ( Int cellX,
Int cellY,
Bool bridge )

Definition at line 3069 of file AIPathfind.cpp.

◆ setPassable()

void PathfindZoneManager::setPassable ( Int cellX,
Int cellY,
Bool passable )

Definition at line 3014 of file AIPathfind.cpp.

◆ updateZonesForModify()

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.


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