// Square.h: interface for the Square class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SQUARE_H__030453A4_979C_4921_AFF8_C0A8489AF438__INCLUDED_)
#define AFX_SQUARE_H__030453A4_979C_4921_AFF8_C0A8489AF438__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class Square  
{
public:
	Square();
	virtual ~Square();
	char front;
	char top;
	char back;
	char bottom;
	int rot;
	char getFront();
	void rotateForw();
	void rotateBack();
	void clear();
	bool empty();
	int index;

private:


};


Square::Square()
{
	front = ' ';
	top = ' ';
	back = ' ';
	bottom = ' ';
}

void Square::clear()
{
	front = ' ';
	top = ' ';
	back = ' ';
	bottom = ' ';
}

Square::~Square()
{

}

char Square::getFront()
{
	if(rot == 0) return front;
    else if(rot == 90) return top;
	else if(rot == 180) return back;
	else if(rot == 270) return bottom;
	else return '!';
}

void Square::rotateForw()
{
	rot =(rot+ 90)%360;
}
void Square::rotateBack()
{
	rot =(rot- 90)%360;
}

bool Square::empty()
{
	if(front == ' ' && top == ' ' && back == ' ' && bottom == ' ')
		return true;
	else return false;
}
#endif // !defined(AFX_SQUARE_H__030453A4_979C_4921_AFF8_C0A8489AF438__INCLUDED_)
