#include <astar2.h>
Inheritance diagram for AStar3D:

Public Types | |
| typedef float | DistanceType |
| typedef vector< PathPoint > | Path |
Public Member Functions | |
| AStar3D (GameMap *actmap, Vehicle *veh, bool markTemps_=true, int maxDistance=maxint) | |
| void | registerOperationLimiter (OperationLimiter *ol) |
| the search can be restricted to certain operations | |
| void | findPath (const MapCoordinate3D &A, const vector< MapCoordinate3D > &B, Path &path) |
| searches for a path from A to B and stores it in path | |
| void | findPath (Path &path, const MapCoordinate3D &dest) |
| searches for a path from the unit's current position to dest and stores it in path | |
| void | 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 | |
| void | findAllAccessibleFields () |
| searches for all fields that are within the range of maxDist and marks them. | |
| int | getDistance () |
| returns the distance of the last found path, or -1 on any error | |
| int | getTravelTime () |
| returns the number of turns that the unit will need to travel along the last found path | |
| const Node * | fieldVisited (const MapCoordinate3D &fld) |
| checks weather the field fld was among the visited fields during the last search | |
| int & | getFieldAccess (int x, int y) |
| int & | getFieldAccess (const MapCoordinate &mc) |
| virtual | ~AStar3D () |
Public Attributes | |
| Container | visited |
| the reachable fields | |
Static Public Attributes | |
| static const DistanceType | longestPath = 1e9 |
Protected Member Functions | |
| virtual DistanceType | getMoveCost (const MapCoordinate3D &start, const MapCoordinate3D &dest, const Vehicle *vehicle, bool &canStop, bool &hasAttacked) |
| HexDirection & | getPosDir (const MapCoordinate3D &pos) |
| int & | getPosHHop (const MapCoordinate3D &pos) |
| DistanceType | dist (const MapCoordinate3D &a, const MapCoordinate3D &b) |
| DistanceType | dist (const MapCoordinate3D &a, const vector< MapCoordinate3D > &b) |
| bool | get_first (Container &v, Node &n) |
| void | nodeVisited (const Node &n, HexDirection direc, Container &open, int prevHeight=-10, int heightChangeDist=0) |
Protected Attributes | |
| OperationLimiter * | operationLimiter |
| int | MAXIMUM_PATH_LENGTH |
| GameMap * | tempsMarked |
| Path * | _path |
| Vehicle * | veh |
| GameMap * | actmap |
| float | vehicleSpeedFactor [8] |
| bool | markTemps |
| WindMovement * | wind |
| HexDirection * | posDirs |
| int * | posHHops |
| int * | fieldAccess |
Classes | |
| class | Container |
| struct | Node |
| class | OperationLimiter |
| class | PathPoint |
Definition at line 97 of file astar2.h.
|
|
|
|
|
|
|
||||||||||||||||||||
|
Definition at line 430 of file astar2.cpp. References _path, actmap, chfliegend, chhochfliegend, chtieffliegend, DirNone, fieldAccess, Vehicle::getPosition(), Vehicletype::height, longestPath, markTemps, MAXIMUM_PATH_LENGTH, Vehicle::maxMovement(), Vehicletype::movement, posDirs, posHHops, tempsMarked, Vehicle::typ, veh, vehicleSpeedFactor, GameMap::weather, wind, GameMap::Weather::windSpeed, GameMap::xsize, and GameMap::ysize. |
|
|
Definition at line 480 of file astar2.cpp. References GameMap::cleartemps(), fieldAccess, posDirs, posHHops, tempsMarked, and wind. |
|
||||||||||||
|
Definition at line 512 of file astar2.cpp. References dist(), and longestPath. |
|
||||||||||||
|
Definition at line 495 of file astar2.cpp. References beeline(), chfliegend, chhochfliegend, chtieffliegend, MapCoordinate3D::getBitmappedHeight(), MapCoordinate3D::getNumericalHeight(), longestPath, minmalq, MapCoordinate::valid(), wind, and windbeeline(). Referenced by dist(), and findPath(). |
|
|
checks weather the field fld was among the visited fields during the last search
Definition at line 926 of file astar2.cpp. References AStar3D::Container::end(), AStar3D::Container::find(), and visited. Referenced by findPath(). |
|
|
searches for all fields that are within the range of maxDist and marks them. On each field one bit for each level of height will be set. The Destructor removes all marks. Definition at line 907 of file astar2.cpp. References actmap, AStar3D::Container::begin(), GameMap::cleartemps(), AStar3D::Container::end(), findPath(), GameMap::getField(), getFieldAccess(), Vehicle::height, markTemps, tempsMarked, veh, visited, GameMap::xsize, and GameMap::ysize. |
|
||||||||||||
|
searches for a path from the units current position to one of the dest fields and stores it in path
Definition at line 901 of file astar2.cpp. References findPath(), Vehicle::getPosition3D(), and veh. |
|
||||||||||||
|
searches for a path from the unit's current position to dest and stores it in path
Definition at line 894 of file astar2.cpp. References findPath(), Vehicle::getPosition3D(), and veh. |
|
||||||||||||||||
|
||||||||||||
|
|
|
|
returns the distance of the last found path, or -1 on any error
|
|
|
Definition at line 941 of file astar2.cpp. References actmap, fieldAccess, MapCoordinate::x, GameMap::xsize, and MapCoordinate::y. |
|
||||||||||||
|
Definition at line 936 of file astar2.cpp. References actmap, fieldAccess, and GameMap::xsize. Referenced by findAllAccessibleFields(). |
|
||||||||||||||||||||||||
|
Reimplemented in StratAStar3D, and HiddenAStar3D. Definition at line 524 of file astar2.cpp. References actmap, calcMoveMalus(), fieldAccessible(), MapCoordinate3D::getBitmappedHeight(), GameMap::getField(), longestPath, Vehicletype::movement, Vehicle::typ, veh, vehicleSpeedFactor, and wind. Referenced by findPath(), HiddenAStar3D::getMoveCost(), and StratAStar3D::getMoveCost(). |
|
|
Definition at line 152 of file astar2.h. References actmap, MapCoordinate3D::getNumericalHeight(), posDirs, MapCoordinate::x, GameMap::xsize, and MapCoordinate::y. Referenced by findPath(), and nodeVisited(). |
|
|
Definition at line 153 of file astar2.h. References actmap, MapCoordinate3D::getNumericalHeight(), posHHops, MapCoordinate::x, GameMap::xsize, and MapCoordinate::y. Referenced by findPath(), and nodeVisited(). |
|
|
returns the number of turns that the unit will need to travel along the last found path
|
|
||||||||||||||||||||||||
|
Definition at line 567 of file astar2.cpp. References AStar3D::Container::add(), DirNone, getPosDir(), getPosHHop(), longestPath, MAXIMUM_PATH_LENGTH, ReverseDirection(), and AStar3D::Container::update(). Referenced by findPath(). |
|
|
the search can be restricted to certain operations
Definition at line 195 of file astar2.h. References operationLimiter. |
|
|
Definition at line 139 of file astar2.h. Referenced by AStar3D(), and findPath(). |
|
|
Definition at line 141 of file astar2.h. Referenced by AStar3D(), findAllAccessibleFields(), findPath(), getFieldAccess(), getMoveCost(), HiddenAStar3D::getMoveCost(), BaseVehicleMovement::PathFinder::getMovementFields(), getPosDir(), and getPosHHop(). |
|
|
Definition at line 150 of file astar2.h. Referenced by AStar3D(), getFieldAccess(), and ~AStar3D(). |
|
|
Definition at line 614 of file astar2.cpp. Referenced by AStar3D(), dist(), findPath(), getMoveCost(), nodeVisited(), AStar3D::Node::operator<(), and operator>(). |
|
|
Definition at line 143 of file astar2.h. Referenced by AStar3D(), and findAllAccessibleFields(). |
|
|
Definition at line 137 of file astar2.h. Referenced by AStar3D(), findPath(), and nodeVisited(). |
|
|
Definition at line 136 of file astar2.h. Referenced by findPath(), and registerOperationLimiter(). |
|
|
Definition at line 148 of file astar2.h. Referenced by AStar3D(), getPosDir(), and ~AStar3D(). |
|
|
Definition at line 149 of file astar2.h. Referenced by AStar3D(), getPosHHop(), and ~AStar3D(). |
|
|
Definition at line 138 of file astar2.h. Referenced by AStar3D(), findAllAccessibleFields(), and ~AStar3D(). |
|
|
Definition at line 140 of file astar2.h. Referenced by AStar3D(), findAllAccessibleFields(), findPath(), getMoveCost(), and BaseVehicleMovement::PathFinder::getMovementFields(). |
|
|
Definition at line 142 of file astar2.h. Referenced by AStar3D(), and getMoveCost(). |
|
|
the reachable fields
Definition at line 180 of file astar2.h. Referenced by fieldVisited(), findAllAccessibleFields(), findPath(), and BaseVehicleMovement::PathFinder::getMovementFields(). |
|
|
Definition at line 144 of file astar2.h. Referenced by AStar3D(), dist(), getMoveCost(), and ~AStar3D(). |
1.4.2