#ifndef LINKED_GAME_H #define LINKED_GAME_H #include #include "Game.h" using namespace std; /** * An linked-based implementation of the game class. */ class LinkedGame : public Game { public: /** * A constructor, where the parameters N and K are interpetted, as * described in the documentation for the class Game, and which are * assumed to be positive integers. */ LinkedGame(int N, int K); /** * Returns the number of players who currently remaining in the game. */ int size() const; /** * Plays a single round, eliminating one player. This method can be * called repeatedly to simulate several consecutive rounds of the * game. * * The ID of the removed player should be returned. */ int playRound(); /** * Completes the entire game, from the current state. * (i.e. equivalent to calling playRound repeatedly until size is * one). * * The return value should be the ID of the sole surviving player. */ int completeGame(); /** * This method toggles the 'verbose' setting. The return value * indicates the new setting. * * The default behavior should be with verbose set to false, in * which case no output is to be generated by the other methods. * * If verbose is set to true, subsequent steps of the game should * produce a message, printed to the standard output stream, to * document the play of the game. * * This method may be called more than once, if setting changes are * desired while a game is in progress. */ bool toggleVerbose(); /** * Destructor */ ~LinkedGame(); private: // add any private methods or private state information which you // deem necessary }; #endif