#include "SquareGraph.h"

#include "MemoryManager/debugNew.h"


using namespace ground;
using namespace std;

SquareGraph::SquareGraph(void)
{
}

SquareGraph::~SquareGraph(void)
{
}

void SquareGraph::setNodes(std::vector<SquareNode*>& nodes){
	for (vector<SquareNode*>::iterator it = nodes.begin(); it != nodes.end(); ++it){
		squareGraph.push_back(*it);
		graph.push_back(*it);
	}
}

void SquareGraph::initialisePathFinding(){
	for (vector<SquareNode*>::iterator it = squareGraph.begin(); it != squareGraph.end(); ++it){
		(*it)->setCostWithHeuristic(-1.0f);
		(*it)->setCostWithoutHeuristic(-1.0f);
		(*it)->setFinished(false);
		(*it)->setParent(NULL);
	}
}

vector<GraphNode*>& SquareGraph::getNodes(){
	return graph;
}

