X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fgame.h;h=aebda9dfba671ec5f445ee2c1a6c9365fbb59044;hp=1212b891e924d9a4cd741b1fe66a1eb4ddd6f25d;hb=e1153eebe8cfd0c881cef2ff8fca63f130e736b3;hpb=1a03b2543b67f0551e62babec4cd119f1e0e4640 diff --git a/judge/manager/game.h b/judge/manager/game.h index 1212b89..aebda9d 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(); @@ -34,6 +35,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 +65,9 @@ class Game int maxTurns; const bool printBoard; + + private: + double timeoutTime; };