#ifndef PIECE_H #define PIECE_H class Board; #include #include "Space.h" #include "Board.h" #include "./enumerations.h" using namespace std; class Piece{ public: Piece(){numberOfTimesRotated=0; iCenterBlackSquare=0;} ~Piece(){}; // operations void AddSquare(Space* s); int RemoveFromBoard(Board* theBoard); int RotateCounterClockwise(unsigned int howManyTimes=1); // nonzero returned if piece has gone thru full circle int RecenterAtNextBlackSquare(); // nonzero returned if we are back at first black square int RecenterAtOriginalSquare(); void ResetConfiguration(); // getters int NumberOfSquares(){return spaces.size();} vector TheSpaces(){return spaces;} int GetId(){return id;} int HowManyTimesRotated(){return numberOfTimesRotated;} bool IsOnBoard(){return isOnBoard;} int RowOfPieceOnBoard(){return rowOfCenterSquare;} int ColumnOfPieceOnBoard(){return columnOfCenterSquare;} // setters void SetColumnOfPieceOnBoard(int col){columnOfCenterSquare=col;} void SetRowOfPieceOnBoard(int row){rowOfCenterSquare=row;} void SetOnBoardOrNot(bool onBoard){isOnBoard=onBoard;} void SetId(int uniqueId){id = uniqueId;} void ResetNumberOfTimesRotated(){numberOfTimesRotated=0;} private: int Recenter(); vector spaces; vector blackSpaces; unsigned int iCenterBlackSquare; // this tells which black space is "0,0" in relative coordinates int numberOfTimesRotated; // between 0 and 3. How many times has it been rotated? int columnOfCenterSquare; int rowOfCenterSquare; bool isOnBoard; int id; }; #endif