X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fgame.h;h=5a5f8a633c3ceeb728e5cb17288ee8822a1dfe70;hp=43f4d0e7f6cb287393cd77c32794880051f6fc07;hb=5f9adddd695f2664a0d690b59a779e40b51ade3d;hpb=78293905481ab7a67e773d05350da29940a58ea6 diff --git a/judge/manager/game.h b/judge/manager/game.h index 43f4d0e..5a5f8a6 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, const char * newImageOutput = ""); + 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, const char * newImageOutput = ""); 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,10 @@ class Game int maxTurns; const bool printBoard; + + private: + double timeoutTime; + std::string imageOutput; }; @@ -83,6 +94,7 @@ class FileController : public Controller }; +std::string itostr(int i); #endif //MAIN_H