-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.hh
52 lines (38 loc) · 942 Bytes
/
Player.hh
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
#ifndef Player_hh
#define Player_hh
#include "Info.hh"
#include "Action.hh"
#include "Random.hh"
#include "Registry.hh"
/***
* Abstract base class for players.
* *
* This class uses multiple inheritance from Info and Action,
* so that their public operations can been used from within Player.
*
* In order to create new players, inherit from this class and register them.
* See for example Null.cc and Demo.cc.
*/
class Player : public Info, public Random_generator, public Action {
friend class Game;
friend class SecGame;
int me_;
inline void reset (const Info& info) {
*static_cast<Action*>(this) = Action();
*static_cast<State*>(this) = (State)info;
}
void reset (ifstream& is);
public:
/**
* Play intelligence. Will be overwritten, thus declared virtual.
*/
virtual void play () {
};
/**
* Identifier of my player.
*/
inline int me () const {
return me_;
}
};
#endif