//-------------------------------------------------------------------------------------------------------------------- // Define the interface to the player task for the telephone game. //-------------------------------------------------------------------------------------------------------------------- const int NUMPLAYERS = 5; // Number of players in the game const int TIMESAROUND = 2; // Number of times the message goes around the ring of players _Task Player { public: enum Status {Active, Blocked}; // Possible states of the players at any given moment. private: Status *StateInformation; // Contains status of each task. int &gameOver; // Location of value which indicates the game is over. int id; // Identity of player Player *nextPlayer; // Identity of next player in circle. char *message; // Message being passed around the ring. void main(); // Main body of task. void perturbMessage(); // Randomly perturbs the message. void printInfo(); // Print status of game and message at this point. public: ~Player(); Player( Status SI[], int &newgameOver, Player *next, int whoami ); void SetPlayer(Player * next) {nextPlayer = next;} // Sets id of next player. void SendMessage(char * m); // Transfers message over. };