-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhuman.hpp
53 lines (42 loc) · 855 Bytes
/
human.hpp
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
#ifndef HUMAN_HPP
#define HUMAN_HPP
#include "player.h"
#include "match.h"
#include "graphicsscene.h"
using namespace std;
class Human : public Player
{
CellState color;
GraphicsScene *scene;
public:
Human(GraphicsScene *s)
{
scene = s;
}
void setTurnTime(int miliseconds)
{
Q_UNUSED(miliseconds);
}
void setColor(CellState c)
{
color = c;
}
CellState getColor()
{
return color;
}
QString name()
{
return "Human";
}
void turnStart(Match)
{
connect(scene, SIGNAL(clicked(Position)), this, SLOT(processClick(Position)));
}
void processClick(Position p)
{
disconnect(scene, SIGNAL(clicked(Position)), this, SLOT(processClick(Position)));
emit turnFinished(this, p);
}
};
#endif // HUMAN_HPP