-
Notifications
You must be signed in to change notification settings - Fork 16
/
GameState.h
54 lines (44 loc) · 1.4 KB
/
GameState.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
#ifndef GAMESTATE_H_INCLUDED
#define GAMESTATE_H_INCLUDED
#include <vector>
#include <string>
#include "FastState.h"
#include "FullBoard.h"
#include "KoState.h"
#include "TimeControl.h"
class GameState : public KoState {
public:
explicit GameState() = default;
explicit GameState(const KoState* rhs) {
// Copy in fields from base class.
*(static_cast<KoState*>(this)) = *rhs;
anchor_game_history();
};
void init_game(int size, float komi);
void reset_game();
bool set_fixed_handicap(int stones);
int set_fixed_handicap_2(int stones);
void place_free_handicap(int stones);
void anchor_game_history(void);
void trim_game_history(int lastmove);
void rewind(void); /* undo infinite */
bool undo_move(void);
bool forward_move(void);
void play_move(int color, int vertex);
void play_move(int vertex);
void play_pass();
bool play_textmove(std::string color, std::string vertex);
void start_clock(int color);
void stop_clock(int color);
TimeControl& get_timecontrol();
void set_timecontrol(int maintime, int byotime, int byostones,
int byoperiods);
void set_timecontrol(TimeControl tmc);
void adjust_time(int color, int time, int stones);
void display_state();
private:
bool valid_handicap(int stones);
std::vector<KoState> game_history;
TimeControl m_timecontrol;
};
#endif