HOG2
Enumerations | Functions | Variables
GraphSearchConstants Namespace Reference

Enumerations

enum  {
  kHCost = 0, kXCoordinate = 5, kYCoordinate = 6, kZCoordinate = 7,
  kTemporaryLabel = 8, kMapX = 9, kMapY = 10, kFirstData = 11
}
 

Functions

GraphGetUndirectedGraph (Map *m)
 GetMapGraph(map) More...
 
GraphGetGraph (Map *m)
 
GraphGetEightConnectedGraph (Map *m, bool directed)
 
GraphGetFourConnectedGraph (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
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kHCost 
kXCoordinate 
kYCoordinate 
kZCoordinate 
kTemporaryLabel 
kMapX 
kMapY 
kFirstData 

Definition at line 49 of file GraphEnvironment.h.

Function Documentation

◆ AddEdges()

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().

◆ AddNodesToGraph()

void GraphSearchConstants::AddNodesToGraph ( Map m,
Graph g 
)

◆ GetEightConnectedGraph()

Graph * GraphSearchConstants::GetEightConnectedGraph ( Map m,
bool  directed 
)

◆ GetFourConnectedGraph()

Graph * GraphSearchConstants::GetFourConnectedGraph ( Map m,
bool  directed 
)

◆ GetGraph()

Graph * GraphSearchConstants::GetGraph ( Map m)

Definition at line 851 of file GraphEnvironment.cpp.

References GetEightConnectedGraph().

Referenced by MyPathfindingKeyHandler(), and MyRandomUnitKeyHandler().

◆ GetUndirectedGraph()

Graph * GraphSearchConstants::GetUndirectedGraph ( Map m)

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().

Variable Documentation

◆ kDiagonalEdgeCost

const double GraphSearchConstants::kDiagonalEdgeCost = ROOT_TWO

Definition at line 61 of file GraphEnvironment.h.

◆ kStraightEdgeCost

const double GraphSearchConstants::kStraightEdgeCost = 1.0

Definition at line 60 of file GraphEnvironment.h.