-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGobanControl.h
56 lines (46 loc) · 1.28 KB
/
GobanControl.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
#ifndef GOBAN_GOBANCONTROL_H
#define GOBAN_GOBANCONTROL_H
#include "GameThread.h"
#include "GobanModel.h"
#include "GobanView.h"
#include "Configuration.h"
class ElementGame;
class GobanControl {
public:
GobanControl(ElementGame* p, GobanModel& m, GobanView& v, GameThread& e)
: parent(p), model(m), view(v), engine(e),
initialized(false), exit(false), mouseX(-1), mouseY(-1), fullscreen(false)
{
}
~GobanControl() { destroy(); }
void destroy();
void mouseClick(int button, int state, int x, int y);
void mouseMove(int x, int y);
void keyPress(int key, int x, int y, bool downNotUp = false);
bool isExiting() {
return exit;
}
bool requestExit() {
exit = true;
Shell::RequestExit();
return true;
}
bool newGame(int boardSize);
void togglePlayer(int which, int delta = 1);
void switchPlayer(int which, int idx);
void switchShader(int idx);
void increaseHandicap();
bool setHandicap(int);
bool setKomi(float);
bool command(const std::string& cmd);
private:
ElementGame* parent;
GobanModel& model;
GobanView& view;
GameThread& engine;
bool initialized;
bool exit;
float mouseX, mouseY;
bool fullscreen;
};
#endif //GOBAN_GOBANCONTROL_H