-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
66 lines (55 loc) · 1013 Bytes
/
game.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
64
65
66
#pragma once
#include "routerman.h"
#include "agent.h"
#include "button.h"
#include "i2.h"
#include "gl.h"
#include "othello.h"
#include <vector>
enum Stat{
READY,
PLAY,
PAUSE,
WAIT,
TURN,
THINK,
END,
GAMEOVER
};
enum PlayerMode{
HUMAN,
AGENT,
ROUTERMAN,
};
class Game : public GL{
int width,height;
Othello *othello;
vector<Othello> history;
Button reset_button;
Button undo_button;
Button play_button;
Button player_button[2];
Machine *machine[2];
int stat;
PlayerMode player_mode[2];
I2 cursor_square;
I2 before_square[2];
bool turn; //false:BLACK true:WHITE
I2 result;
unsigned int global_time,sub_time;
stringstream message;
protected:
public:
void mouse_click(int state ,int button, I2 point);
void mouse_motion(I2 point);
void key(unsigned char k, int x, int y);
void timer(int dt);
void display();
I2 cursor_adjust(I2 point);
void reshape(GLsizei width, GLsizei height);
void undo();
void proc();
void result_message();
Game();
};
extern Game *game;