Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ROUTER PLUGIN
- - GPS ADDITION TO SA-MP
- - Made By Gamer_Z a.k.a. grasmanek94 , Rafal Grasman
- October-2011
- contact: grasmanek94@live.nl
- http://gpb.googlecode.com/
- */
- #include "Node.h"
- Node::Node(void)
- {
- }
- Node::Node(/*const std::string&*/int name, bool exists) : mGCost(0), mTotal(0), mClosed(false), mpParent(NULL), mName(name), mHeur(exists)
- {
- }
- Node::~Node(void)
- {
- while(!mEdges.empty())
- {
- delete mEdges.back();
- mEdges.pop_back();
- }
- }
- int Node::getName(void)
- {
- return mName;
- }
- void Node::createEdge(Node* pTarget, int moveCost)
- {
- mEdges.push_back(new Edge(pTarget, moveCost));
- }
- void Node::setClosed(bool closed)
- {
- mClosed = closed;
- }
- bool Node::getClosed(void)
- {
- return mClosed;
- }
- std::vector<Edge*>* Node::getEdges(void)
- {
- return &mEdges;
- }
- int Node::getGCost(void)
- {
- return mGCost;
- }
- void Node::setGCost(int cost)
- {
- mGCost = cost;
- }
- void Node::calcFCost(void)
- {
- mTotal = mGCost;
- }
- void Node::setParent(Node* pParent)
- {
- mpParent = pParent;
- }
- int Node::getFCost(void)
- {
- return mTotal;
- }
- bool Node::DoesExist(void)
- {
- return mHeur;
- }
- bool Node::DoesExist_yes(void)
- {
- mHeur = true;
- return true;
- }
- Node* Node::getParent(void)
- {
- return mpParent;
- }
- void Node::reset(void)
- {
- mGCost = 0;
- mTotal = 0;
- mClosed = false;
- mpParent = NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement