Fixed bugs, minor changes
[progcomp2012.git] / progcomp / judge / manager / controller.h
1 #ifndef CONTROLLER_H
2 #define CONTROLLER_H
3
4 #include "stratego.h"
5 #include <string>
6
7 /**
8  * Class to control a player for Stratego
9  * Abstract base class
10  */
11
12 class Controller
13 {
14         public:
15                 Controller(const Piece::Colour & newColour, const char * newName = "no-name") : colour(newColour), name(newName) {}
16                 virtual ~Controller() {}
17
18                 MovementResult Setup(const char * opponentName);
19
20                 MovementResult MakeMove(std::string & buffer);
21
22                 virtual bool HumanController() const {return false;} //Hacky... overrides in human_controller... avoids having to use run time type info
23
24                 void Message(const std::string & buffer) {Message(buffer.c_str());}
25                 virtual void Message(const char * string) = 0;
26
27                 virtual MovementResult QuerySetup(const char * opponentName, std::string setup[]) = 0;
28                 virtual MovementResult QueryMove(std::string & buffer) = 0;
29                 virtual bool Valid() const {return true;}
30
31                 const Piece::Colour colour; 
32
33                 std::string name;
34
35
36 };
37
38
39
40
41
42 #endif //CONTROLLER_H
43
44

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