X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=manager%2Fgame.h;h=5a5f8a633c3ceeb728e5cb17288ee8822a1dfe70;hb=HEAD;hp=f6d7b6bc92552903ad4d3374d60666c9642e4e91;hpb=b563784f7e8b559fc100e174331c99fc6a1beda8;p=progcomp2012.git diff --git a/manager/game.h b/manager/game.h deleted file mode 100644 index f6d7b6b..0000000 --- a/manager/game.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#include "stratego.h" -#include "ai_controller.h" -#include "human_controller.h" - - - -/** - * Class to manage the game - */ -class Game -{ - public: - Game(const char * redPath, const char * bluePath, const bool enableGraphics, double newStallTime = 1.0, const bool allowIllegal=false, FILE * newLog = NULL, const Piece::Colour & newRevealed = Piece::BOTH, int maxTurns = 5000, const bool printBoard = false); - Game(const char * fromFile, const bool enableGraphics, double newStallTime = 1.0, const bool allowIllegal=false, FILE * newLog = NULL, const Piece::Colour & newRevealed = Piece::BOTH, int maxTurns = 5000, const bool printBoard = false); - virtual ~Game(); - - - - void Wait(double wait); - - bool Setup(const char * redName, const char * blueName); - MovementResult Play(); - void PrintEndMessage(const MovementResult & result); - - - static void HandleBrokenPipe(int signal); - - - const Piece::Colour Turn() const {return turn;} - int TurnCount() const {return turnCount;} - - static Game * theGame; - public: - int logMessage(const char * format, ...); - FILE * GetLogFile() const {return log;} - Controller * red; - Controller * blue; - private: - Piece::Colour turn; - - public: - Board theBoard; - private: - const bool graphicsEnabled; - double stallTime; - public: - const bool allowIllegalMoves; - - private: - FILE * log; - - Piece::Colour reveal; - int turnCount; - - static bool gameCreated; - - FILE * input; - - int maxTurns; - const bool printBoard; - -}; - -class FileController : public Controller -{ - public: - FileController(const Piece::Colour & newColour, FILE * newFile) : Controller(newColour, "file"), file(newFile) {} - virtual ~FileController() {} - - virtual void Message(const char * string) {} //Don't send messages - virtual MovementResult QuerySetup(const char * opponentName, std::string setup[]); - virtual MovementResult QueryMove(std::string & buffer); - virtual bool Valid() const {return file != NULL;} - - private: - FILE * file; - - -}; - - - -#endif //MAIN_H