controller.h 718 Bytes
Newer Older
Sam Moore's avatar
Sam Moore committed
1
2
3
4
#ifndef CONTROLLER_H
#define CONTROLLER_H

#include "stratego.h"
5
#include <string>
Sam Moore's avatar
Sam Moore committed
6
7

/**
8
9
 * Class to control a player for Stratego
 * Abstract base class
Sam Moore's avatar
Sam Moore committed
10
11
 */

12
class Controller
Sam Moore's avatar
Sam Moore committed
13
14
{
	public:
15
		Controller(const Piece::Colour & newColour) : colour(newColour) {}
Sam Moore's avatar
Sam Moore committed
16
17
		virtual ~Controller() {}

18
		MovementResult Setup(const char * opponentName);
Sam Moore's avatar
Sam Moore committed
19

20
		MovementResult MakeMove(std::string & buffer);
Sam Moore's avatar
Sam Moore committed
21

22
23
24
25
26
27
28
29
30


		void Message(std::string & buffer) {Message(buffer.c_str());}
		virtual void Message(const char * string) = 0;

		virtual MovementResult QuerySetup(const char * opponentName, std::string setup[]) = 0;
		virtual MovementResult QueryMove(std::string & buffer) = 0;

		const Piece::Colour colour; 
Sam Moore's avatar
Sam Moore committed
31
32
33
34


};

35
36
37
38




Sam Moore's avatar
Sam Moore committed
39
40
41
#endif //CONTROLLER_H