#include <Level.h>
Collaboration diagram for ASR::Level::LevelNode:
Public Member Functions | |
LevelNode (Vector3 worldPos, float traversalCost=1.0f) | |
void | setTraversalCost (float cost) |
int | getNumNeighbours () const |
LevelNode * | getNeighbour (int index) const |
float | getTraversalCost () const |
float | getEstimatedCostToState (const LevelNode &state) const |
Vector3 | getWorldPosition () |
bool | operator== (const LevelNode &rhs) const |
bool | isNode (const LevelNode &rhs) const |
Private Attributes | |
Vector3 | mWorldPos |
float | mTraversalCost |
unsigned int | mId |
bool | mChecked |
int | mNumNeighbours |
LevelNode * | mNeighbours [8] |
Friends | |
class | Level |
Definition at line 62 of file Level.h.
ASR::Level::LevelNode::LevelNode | ( | Vector3 | worldPos, | |
float | traversalCost = 1.0f | |||
) | [inline] |
Definition at line 85 of file Level.h.
References mNeighbours.
00086 : mWorldPos ( worldPos ), mTraversalCost ( traversalCost ), 00087 mNumNeighbours ( 0 ) 00088 { 00089 for ( int i = 0; i < 8; i++ ) 00090 { 00091 mNeighbours[i] = NULL; 00092 } 00093 }
float ASR::Level::LevelNode::getEstimatedCostToState | ( | const LevelNode & | state | ) | const [inline] |
LevelNode* ASR::Level::LevelNode::getNeighbour | ( | int | index | ) | const [inline] |
Definition at line 110 of file Level.h.
References mNeighbours, and mNumNeighbours.
Referenced by ASR::Level::getClosestNode().
00111 { 00112 assert ( index < mNumNeighbours ); 00113 return mNeighbours[index]; 00114 }
int ASR::Level::LevelNode::getNumNeighbours | ( | ) | const [inline] |
Definition at line 104 of file Level.h.
References mNumNeighbours.
Referenced by ASR::Level::getClosestNode().
00105 { 00106 return mNumNeighbours; 00107 }
float ASR::Level::LevelNode::getTraversalCost | ( | ) | const [inline] |
Definition at line 117 of file Level.h.
References mTraversalCost.
Referenced by ASR::Level::getClosestNode().
00118 { 00119 return mTraversalCost; 00120 }
Vector3 ASR::Level::LevelNode::getWorldPosition | ( | ) | [inline] |
bool ASR::Level::LevelNode::isNode | ( | const LevelNode & | rhs | ) | const [inline] |
Definition at line 148 of file Level.h.
References operator==().
00149 { 00150 return operator== ( rhs ); 00151 }
bool ASR::Level::LevelNode::operator== | ( | const LevelNode & | rhs | ) | const [inline] |
void ASR::Level::LevelNode::setTraversalCost | ( | float | cost | ) | [inline] |
Definition at line 95 of file Level.h.
References mTraversalCost.
00096 { 00097 mTraversalCost = cost; 00098 }
bool ASR::Level::LevelNode::mChecked [private] |
unsigned int ASR::Level::LevelNode::mId [private] |
LevelNode* ASR::Level::LevelNode::mNeighbours[8] [private] |
int ASR::Level::LevelNode::mNumNeighbours [private] |
float ASR::Level::LevelNode::mTraversalCost [private] |
Vector3 ASR::Level::LevelNode::mWorldPos [private] |
Definition at line 69 of file Level.h.
Referenced by getEstimatedCostToState(), getWorldPosition(), and operator==().