[RULE CHANGE] *Victory by "attrition"* + Bug fixes
[progcomp2012.git] / judge / manager / game.h
index 1212b89..aebda9d 100644 (file)
@@ -4,17 +4,18 @@
 #include "stratego.h"
 #include "ai_controller.h"
 #include "human_controller.h"
 #include "stratego.h"
 #include "ai_controller.h"
 #include "human_controller.h"
-
+#include <cstring>
 
 
 /**
  * Class to manage the game
 
 
 /**
  * Class to manage the game
+ * Bit messy since I keep adding on parameters :P
  */
 class Game
 {
        public:
  */
 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();
 
                
                virtual ~Game();
 
                
@@ -34,6 +35,7 @@ class Game
                int TurnCount() const {return turnCount;}
 
                static Game * theGame;
                int TurnCount() const {return turnCount;}
 
                static Game * theGame;
+               static int Tokenise(std::vector<std::string> & buffer, std::string & str, char split = ' '); //Helper - Split a string into tokens
        public:
                int logMessage(const char * format, ...);
                FILE * GetLogFile() const {return log;}
        public:
                int logMessage(const char * format, ...);
                FILE * GetLogFile() const {return log;}
@@ -63,6 +65,9 @@ class Game
 
                int maxTurns;
                const bool printBoard;
 
                int maxTurns;
                const bool printBoard;
+
+       private:
+               double timeoutTime;
                
 };
 
                
 };
 

UCC git Repository :: git.ucc.asn.au