Advanced Strategic Command
Public Member Functions | Protected Member Functions | List of all members
AntiMineAStar3D Class Reference

A 3D path finding algorithm which avoids units to jam; used by the AI's strategy module. More...

#include <ai_common.h>

Inheritance diagram for AntiMineAStar3D:
Inheritance graph
[legend]

Public Member Functions

 AntiMineAStar3D (AI *_ai, Vehicle *veh, bool markTemps_=true)
 
- Public Member Functions inherited from AStar3D
 AStar3D (GameMap *actmap, Vehicle *veh, bool markTemps_=true, int maxDistance=maxint)
 
void registerOperationLimiter (OperationLimiter *ol)
 the search can be restricted to certain operations More...
 
bool findPath (const MapCoordinate3D &dest)
 searches for a path from the unit's current position to dest More...
 
bool findPath (const vector< MapCoordinate3D > &dest)
 searches for a path from the units current position to one of the dest fields More...
 
void findPath (Path &path, const MapCoordinate3D &dest)
 searches for a path from the unit's current position to dest and stores it in path More...
 
bool findPath (Path &path, const vector< MapCoordinate3D > &dest)
 searches for a path from the units current position to one of the dest fields and stores it in path More...
 
void findAllAccessibleFields ()
 searches for all fields that are within the range of maxDist and marks them. More...
 
bool constructPath (Path &path, const Node *n)
 construct a path from a pointer to a visited node, return false if pointer is NULL, else true More...
 
bool constructPath (Path &path, const MapCoordinate3D &pos)
 construct a path from a pointer to a visited node; return false if position doesn't exist, else true More...
 
int getDistance ()
 returns the distance of the last found path, or -1 on any error More...
 
int getTravelTime ()
 returns the number of turns that the unit will need to travel along the last found path More...
 
int getFieldAccess (int x, int y)
 
int getFieldAccess (const MapCoordinate &mc)
 
void dumpVisited ()
 for debugging: dumps the contents of the visited node to stdout More...
 
virtual ~AStar3D ()
 

Protected Member Functions

virtual DistanceType getMoveCost (const MapCoordinate3D &start, const MapCoordinate3D &dest, const Vehicle *vehicle, bool &hasAttacked)
 
- Protected Member Functions inherited from AStar3D
DistanceType dist (const MapCoordinate3D &a, const MapCoordinate3D &b)
 
DistanceType dist (const MapCoordinate3D &a, const vector< MapCoordinate3D > &b)
 
int initNode (Node &newN, const Node *oldN_ptr, const MapCoordinate3D &newpos, const vector< MapCoordinate3D > &B, bool disableAttack=false, bool enter=false, bool dock=false)
 

Additional Inherited Members

- Public Types inherited from AStar3D
typedef float DistanceType
 
typedef deque< PathPointPath
 
- Public Attributes inherited from AStar3D
VisitedContainer visited
 
- Static Public Attributes inherited from AStar3D
static const DistanceType longestPath = 1e9
 
- Protected Types inherited from AStar3D
typedef boost::unordered_map
< MapCoordinate, int,
hash_MapCoordinate
fieldAccessType
 
- Protected Attributes inherited from AStar3D
OperationLimiteroperationLimiter
 
int MAXIMUM_PATH_LENGTH
 
GameMaptempsMarked
 
Path_path
 
Vehicleveh
 
GameMapactmap
 
float vehicleSpeedFactor [8]
 
float maxVehicleSpeedFactor
 
bool markTemps
 
WindMovementwind
 
fieldAccessType fieldAccess
 

Detailed Description

A 3D path finding algorithm which avoids units to jam; used by the AI's strategy module.

Definition at line 79 of file ai_common.h.

Constructor & Destructor Documentation

AntiMineAStar3D::AntiMineAStar3D ( AI _ai,
Vehicle veh,
bool  markTemps_ = true 
)
inline

Definition at line 91 of file ai_common.h.

Member Function Documentation

virtual DistanceType AntiMineAStar3D::getMoveCost ( const MapCoordinate3D start,
const MapCoordinate3D dest,
const Vehicle vehicle,
bool &  hasAttacked 
)
inlineprotectedvirtual

Reimplemented from AStar3D.

Definition at line 82 of file ai_common.h.

References GameMap::getField(), AI::getMap(), AStar3D::getMoveCost(), and MapField::mineattacks().


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