ai_controller.h 812 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef AI_CONTROLLER_H
#define AI_CONTROLLER_H

#include "controller.h"
#include "program.h"

/**
 * Class to control an AI program playing Stratego
 * Inherits mostly from Program
 */
class AI_Controller : public Controller, private Program
{
	public:
		AI_Controller(const Piece::Colour & newColour, const char * executablePath, const double newTimeout = 2.0) : Controller(newColour), Program(executablePath), timeout(newTimeout) {}
		virtual ~AI_Controller() {}

		

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

		virtual void Message(const char * message) {Program::SendMessage(message);}


	private:
		const double timeout; //Timeout in seconds for messages from the AI Program

};

#endif //AI_CONTROLLER_H