X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fgame.h;h=2ed35f6b593ce1d05f357370fb532ea993c1eef7;hp=1212b891e924d9a4cd741b1fe66a1eb4ddd6f25d;hb=85cfed04e179dad45eefd9fdf747628addbf93fb;hpb=1a03b2543b67f0551e62babec4cd119f1e0e4640 diff --git a/judge/manager/game.h b/judge/manager/game.h index 1212b89..2ed35f6 100644 --- a/judge/manager/game.h +++ b/judge/manager/game.h @@ -4,17 +4,18 @@ #include "stratego.h" #include "ai_controller.h" #include "human_controller.h" - +#include /** * Class to manage the game + * Bit messy since I keep adding on parameters :P */ 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); + 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, double newTimeoutTime = 2.0); + 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, double newTimeoutTime = 2.0); virtual ~Game(); @@ -22,6 +23,7 @@ class Game void Wait(double wait); Piece::Colour Setup(const char * redName, const char * blueName); + MovementResult CheckVictoryAttrition(); MovementResult Play(); void PrintEndMessage(const MovementResult & result); @@ -34,6 +36,7 @@ class Game int TurnCount() const {return turnCount;} static Game * theGame; + static int Tokenise(std::vector & buffer, std::string & str, char split = ' '); //Helper - Split a string into tokens public: int logMessage(const char * format, ...); FILE * GetLogFile() const {return log;} @@ -63,6 +66,9 @@ class Game int maxTurns; const bool printBoard; + + private: + double timeoutTime; };