X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fgame.h;h=3f46abb43ff8a4c5d4f3151a6a60bbcc44281d87;hp=1212b891e924d9a4cd741b1fe66a1eb4ddd6f25d;hb=341297b4dce9528d54fe9dceeff0d6dc33f70abe;hpb=1a03b2543b67f0551e62babec4cd119f1e0e4640 diff --git a/judge/manager/game.h b/judge/manager/game.h index 1212b89..3f46abb 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); + 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,10 @@ 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 + + private: + void MakeControllers(const char * redPath, const char * bluePath); //Create a controller based off a path public: int logMessage(const char * format, ...); FILE * GetLogFile() const {return log;} @@ -63,6 +70,9 @@ class Game int maxTurns; const bool printBoard; + + private: + double timeoutTime; };