X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fgame.h;h=cc79e656bd278be678ebc1b4467c314836eb9551;hp=1212b891e924d9a4cd741b1fe66a1eb4ddd6f25d;hb=48216daa641008e0de21c5522d6e958a38b02093;hpb=1a03b2543b67f0551e62babec4cd119f1e0e4640 diff --git a/judge/manager/game.h b/judge/manager/game.h index 1212b89..cc79e65 100644 --- a/judge/manager/game.h +++ b/judge/manager/game.h @@ -4,17 +4,19 @@ #include "stratego.h" #include "ai_controller.h" #include "human_controller.h" - +#include "network_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, bool server=false, bool client=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, double newTimeoutTime = 2.0); virtual ~Game(); @@ -22,6 +24,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 +37,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 +67,9 @@ class Game int maxTurns; const bool printBoard; + + private: + double timeoutTime; };