-
Notifications
You must be signed in to change notification settings - Fork 0
/
CIntelligence.h
64 lines (51 loc) · 1.52 KB
/
CIntelligence.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef CINTELLIGENCE_H
#define CINTELLIGENCE_H
#include "DIFFICULTY.h"
#include "CPlayer.h"
/**
* Subclass of CPlayer representing AI
*/
class CIntelligence : public CPlayer {
public:
CIntelligence();
virtual ~CIntelligence();
/**
*
* @param d A desired level of difficulty
*/
CIntelligence(int d);
/**
* @brief Change the difficulty level
* @param d New difficulty level
*/
void changeDifficulty(int d);
/**
* @brief Gets move from AI
* @param gS reference to instance of the game
* @param cliSocket socket to be read from
* @return Received move
*/
CMyMove getMove(const CGameSession & gS);
/**
* @brief Gets command from AI
* @param gS reference to instance of the game
* @return Received command
*/
virtual CCommand getCommand(const CGameSession & gS);
private:
/**
* @brief Gets index of the best move in the list of possible moves
* @param list reference to the list of moves
* @param board reference to the chessboard
* @return index of the best move in list of moves
*/
int getBestIdx(CMoveList & list,const CBoard & board) const;
/**
* @brief Removes all faulty (check) moves from the list of all possible moves
* @param list reference to list moves
* @param board reference to the chessboard
*/
void eraseCheckMoves(CMoveList & l, const CGameSession & gS);
int difficulty; ///< The difficulty level
};
#endif /* CINTELLIGENCE_H */