#ifndef COLORSGAMESTATE_H #define COLORSGAMESTATE_H #include #include #include #include "ColorsBoardStructure.h" using namespace std; class ColorsGameState //Holds the gamestate, a game is essentially one of these { public: //fields int numPlayers; //Number of players in the current game, they are numbered 0 to num-1 vector playerHands; //Holds the players' hands int currentPlayer; //Holds the number of the current player vector board; //Holds the current board which is same dimension as numPlayers int deck[76]; //Holds the deck //Numbers 0-6 correspond to colored cards //Every card denoted 0 is the same color and there //are 9 of each color. //7 denotes wilds, there are 3 of these //8 denotes +2 cards and there are 10 of these int *topOfDeck; //Points to the top card of the deck //methods ColorsGameState(int numberOfPlayers); //only constructor //No destructor currently needed bool verifyTypeMove(bool takeMove); //Verifies if the type of move is acceptable bool verifyRowMove(bool takeMove, int rowMove); //Verifies the row affected by the move is valid int acceptMove(bool take, int row); //Enter the move into the gamestate for the current player //take is a boolean representing whether a player takes a row=0 //or puts adds the top card of the deck on that row=1 //row is the row number //Returns 1 if the game is over, 0 normally. int nextPlayer(); //Gives the number of the next player int scorePlayer(int player); //Gives the score for the given player vector scoreAllPlayers(); //Returns a vector in player order of all scores int getTopScore(vector allPlayersScores); //Gives the top score among all players vector getWinners(int winningScore); //Gives the player numbers of the winner(s) starting counting at 1!! bool lastRound(); //Returns true if this is the last round }; #endif