Added image output to manager, added plots to results pages
[progcomp2012.git] / judge / manager / game.h
index aebda9d..5a5f8a6 100644 (file)
@@ -4,6 +4,7 @@
 #include "stratego.h"
 #include "ai_controller.h"
 #include "human_controller.h"
+#include "network_controller.h"
 #include <cstring>
 
 
@@ -14,8 +15,8 @@
 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, 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);
+               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();
 
                
@@ -23,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);
                
@@ -36,6 +38,9 @@ class Game
 
                static Game * theGame;
                static int Tokenise(std::vector<std::string> & 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;}
@@ -68,6 +73,7 @@ class Game
 
        private:
                double timeoutTime;
+               std::string imageOutput;
                
 };
 
@@ -88,6 +94,7 @@ class FileController : public Controller
 
 };
 
+std::string itostr(int i);
 
 
 #endif //MAIN_H

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