/**
FUNCTION: overload == operator
DESCRIPTION: Overloads the == operator so that it can be used to test wheather or not 'this' state is equal to otherState.
RETURN bool - True if in fact 'this' state is equal to otherState
*/
bool state::operator== (const state& otherState) const{
	if(otherState.boardMemoryAllocated == false) return false;
	if(this->getBoard()[0][0] != otherState.getBoard()[0][0])return false;
	if(this->getBoard()[0][1] != otherState.getBoard()[0][1])return false;
	if(this->getBoard()[0][2] != otherState.getBoard()[0][2])return false;
	if(this->getBoard()[1][0] != otherState.getBoard()[1][0])return false;
	if(this->getBoard()[1][1] != otherState.getBoard()[1][1])return false;
	if(this->getBoard()[1][2] != otherState.getBoard()[1][2])return false;
	if(this->getBoard()[2][0] != otherState.getBoard()[2][0])return false;
	if(this->getBoard()[2][1] != otherState.getBoard()[2][1])return false;
	if(this->getBoard()[2][2] != otherState.getBoard()[2][2])return false;
	return true;
}
	/**
	COPY CONSTRUCTOR:  state(const state& obj)
	DESCRIPTION:  Deep copyes obj to this object
	PARAMS:
	obj - The obj that this object is about to become.
	*/
state::state(const state& obj){
	this->g = obj.g;
	this->parent = obj.parent;
	if(obj.boardMemoryAllocated == true){
		this->board = new int*[NUM_ROWS_ON_BOARD];
		for(int i = 0 ; i < NUM_ROWS_ON_BOARD; i++)
		{
			this->board[i] = new int[NUM_COLS_ON_BOARD];
		}
		this->board[0][0] = obj.getBoard()[0][0];
		this->board[0][1] = obj.getBoard()[0][1];
		this->board[0][2] = obj.getBoard()[0][2];
		this->board[1][0] = obj.getBoard()[1][0];
		this->board[1][1] = obj.getBoard()[1][1];
		this->board[1][2] = obj.getBoard()[1][2];
		this->board[2][0] = obj.getBoard()[2][0];
		this->board[2][1] = obj.getBoard()[2][1];
		this->board[2][2] = obj.getBoard()[2][2];
		this->move = obj.move;
	}
}