summaryrefslogtreecommitdiffstats
path: root/AIController.h
blob: 9d10f1739cc4d03398bf7519853f60ea283e8825 (plain)
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
31
32
33
34
35
36
37
38
39
40
#ifndef _AI_CONTROLLER_H
#define _AI_CONTROLLER_H

#include "Controller.h"

#ifndef max
	#define max( a, b ) ( ((a) > (b)) ? (a) : (b) )
#endif

#ifndef min
	#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
#endif

/**
 * Artificial intelligence
 **/
class AIController : public Controller
{
	
public:
	AIController(Player* player, Field& field, int inhibitDelay, int randomThreshold);
	virtual ~AIController(void);

	void think();
	void reset();

private:
	/**
	 * Decide if and in what direction it will turn. Optimized to ben "smart" (with parameters)
	 **/
	void turnRandom();

	Field& m_field;
	int m_inhibit;
	int m_inhibitDelay;
	int m_randomThreshold;
};


#endif