IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
SimplePathNode Class Reference

The simplest possible kind of pathing node. More...

Inheritance diagram for SimplePathNode:
StateNode

Public Member Functions

 SimplePathNode (int _id)
 
void ConnectTo (SimplePathNode *_leads_to)
 Connect this node to another node. More...
 
bool IsConnectedTo (SimplePathNode *targetnode)
 Checks whether a node is reachable from this node in one step. More...
 
vector< SimplePathNode * > & GetConnected ()
 
int GetId ()
 

Private Attributes

int id
 Stores the id of this node.
 
vector< SimplePathNode * > leads_to
 Stores pointers to all neighbors.
 

Detailed Description

The simplest possible kind of pathing node.

It has only neighbors, no position, and connections to neighbors are uni-directional.

Note
To make a connection go both ways, define the connection for both nodes!

Constructor & Destructor Documentation

SimplePathNode::SimplePathNode ( int  _id)
Parameters
_idAn id for this pathing node.
Note
The id should be unique in the set of nodes this node is used with, otherwise algorithms using the node will get very annoyed!

Member Function Documentation

void SimplePathNode::ConnectTo ( SimplePathNode _leads_to)

Connect this node to another node.

Parameters
_leads_toThe node that should be reachable from this node
Note
The connection is uni-directional!
vector<SimplePathNode*>& SimplePathNode::GetConnected ( )
inline
Returns
A reference to a vector containing all direct neighbors of this node
int SimplePathNode::GetId ( )
inline
Returns
The id of this node
bool SimplePathNode::IsConnectedTo ( SimplePathNode targetnode)

Checks whether a node is reachable from this node in one step.

Parameters
targetnodeThe node to check for reachability
Returns
true if targetnode is DIRECTLY reachable from this node

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