[PATCH] Handle case where an AI sends an invalid message and then crashes
[progcomp2012.git] / judge / manager / controller.h
index 55c233d..361f309 100644 (file)
@@ -21,15 +21,21 @@ class Controller
 
                virtual bool HumanController() const {return false;} //Hacky... overrides in human_controller... avoids having to use run time type info
 
-               void Message(const std::string & buffer) {Message(buffer.c_str());}
-               virtual void Message(const char * string) = 0;
+               bool Message(const std::string & buffer) {return Message(buffer.c_str());}
+               virtual bool Message(const char * string) = 0;
 
                virtual MovementResult QuerySetup(const char * opponentName, std::string setup[]) = 0;
                virtual MovementResult QueryMove(std::string & buffer) = 0;
                virtual bool Valid() const {return true;}
 
+
+               virtual void Pause() {}         // Hack function (AI_Controller ONLY will overwrite with wrapper to Program::Pause)
+               virtual void Continue() {}      // Hack function (AI_Controller '' '' wrapper to Program::Continue)
+
                const Piece::Colour colour; 
 
+               virtual void FixName(); //Should be called after setup, sets the name of the controller
+
                std::string name;
 
 

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