HOG2
|
Enumerations | |
enum | { kHCost = 0, kXCoordinate = 5, kYCoordinate = 6, kZCoordinate = 7, kTemporaryLabel = 8, kMapX = 9, kMapY = 10, kFirstData = 11 } |
Functions | |
Graph * | GetUndirectedGraph (Map *m) |
GetMapGraph(map) More... | |
Graph * | GetGraph (Map *m) |
Graph * | GetEightConnectedGraph (Map *m, bool directed) |
Graph * | GetFourConnectedGraph (Map *m, bool directed) |
void | AddNodesToGraph (Map *m, Graph *g) |
void | AddEdges (Map *m, Graph *g, int x, int y, bool directed, double straigtEdgeCost, double diagEdgeCost, int straightEdgeProb, int diagEdgeProb) |
AddEdges(map, Graph, x, y) More... | |
Variables | |
const double | kStraightEdgeCost = 1.0 |
const double | kDiagonalEdgeCost = ROOT_TWO |
anonymous enum |
Enumerator | |
---|---|
kHCost | |
kXCoordinate | |
kYCoordinate | |
kZCoordinate | |
kTemporaryLabel | |
kMapX | |
kMapY | |
kFirstData |
Definition at line 49 of file GraphEnvironment.h.
void GraphSearchConstants::AddEdges | ( | Map * | m, |
Graph * | g, | ||
int | x, | ||
int | y, | ||
bool | directed, | ||
double | straigtEdgeCost, | ||
double | diagEdgeCost, | ||
int | straightEdgeProb, | ||
int | diagEdgeProb | ||
) |
AddEdges(map, Graph, x, y)
This is a helper function for GetMapGraph that does the work of adding the Graph edges. Each edge is only added once, so while the Graph has directional edges, we treat them as being bidirectional.
Definition at line 960 of file GraphEnvironment.cpp.
References Graph::AddEdge(), Map::AdjacentEdges(), Map::GetSplit(), Map::GetTile(), kBackwardSplit, kForwardSplit, kInternalEdge, kLeftEdge, kNoGraphNode, kRightEdge, kTopEdge, halfTile::node, Tile::tile1, and Tile::tile2.
Referenced by GetEightConnectedGraph(), and GetFourConnectedGraph().
Definition at line 884 of file GraphEnvironment.cpp.
References Graph::AddNode(), Map::AdjacentEdges(), Map::GetMapHeight(), Map::GetMapWidth(), Map::GetOpenGLCoord(), Map::GetTerrainType(), Map::GetTile(), kGround, kInternalEdge, kLeftEdge, kMapX, kMapY, kNoGraphNode, kOutOfBounds, kRightEdge, kXCoordinate, kYCoordinate, kZCoordinate, halfTile::node, node::SetLabelF(), node::SetLabelL(), terrainBits, Tile::tile1, and Tile::tile2.
Referenced by GetEightConnectedGraph(), and GetFourConnectedGraph().
Definition at line 854 of file GraphEnvironment.cpp.
References AddEdges(), AddNodesToGraph(), Map::GetMapHeight(), and Map::GetMapWidth().
Referenced by GetGraph(), and GetUndirectedGraph().
Definition at line 869 of file GraphEnvironment.cpp.
References AddEdges(), AddNodesToGraph(), Map::GetMapHeight(), and Map::GetMapWidth().
Definition at line 851 of file GraphEnvironment.cpp.
References GetEightConnectedGraph().
Referenced by MyPathfindingKeyHandler(), and MyRandomUnitKeyHandler().
GetMapGraph(map)
Given a map, this function uses the external map interfaces to turn it into a Graph, and sets the appropriate node numbers for that map. This function should not be called multiple times on the same map, because the original Graph map lose it's association with the map.
Definition at line 848 of file GraphEnvironment.cpp.
References GetEightConnectedGraph().
const double GraphSearchConstants::kDiagonalEdgeCost = ROOT_TWO |
Definition at line 61 of file GraphEnvironment.h.
const double GraphSearchConstants::kStraightEdgeCost = 1.0 |
Definition at line 60 of file GraphEnvironment.h.