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();
void MakeControllers(const char * redPath, const char * bluePath); //Create a controller based off a path
public:
int logMessage(const char * format, ...);
+ static void PrintResults(const MovementResult & result, std::string & buffer);
FILE * GetLogFile() const {return log;}
Controller * red;
Controller * blue;
private:
double timeoutTime;
+ std::string imageOutput;
};
FileController(const Piece::Colour & newColour, FILE * newFile) : Controller(newColour, "file"), file(newFile) {}
virtual ~FileController() {}
- virtual void Message(const char * string) {} //Don't send messages
+ virtual bool Message(const char * string) {return true;} //Don't send messages
virtual MovementResult QuerySetup(const char * opponentName, std::string setup[]);
virtual MovementResult QueryMove(std::string & buffer);
virtual bool Valid() const {return file != NULL;}
};
+std::string itostr(int i);
#endif //MAIN_H