-
Notifications
You must be signed in to change notification settings - Fork 0
/
pivots_game.h
51 lines (45 loc) · 1.18 KB
/
pivots_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
#include "./common/game_obj.h"
class pivots_game
{
public:
bool load_file(char *location);
int request_move_cursor(int x, int y);
int request_pivot(int dir);
int request_pick_drop_pivot(void);
v2i get_bound(void);
v2i pos_start(void);
v2i pos_end(void);
v2i pos_cursor(void);
int grasp_cursor(void);
int num_pivot(void);
v2i pos_pivot(int i);
int dir_pivot(int i);
int num_line(void);
v2i pos_line_pt1(int i);
v2i pos_line_pt2(int i);
bool declare_win(void);
void get_author(char *s);
//for undo and redo keep a list of the command executed and succeeded
//then upon undo execute the pervious item in the list
//would only be for pivots and moving pivots
void undo_move(void);
void redo_move(void);
protected:
char lvl_author[25];
BOUND bound;
START start;
END end;
CURSOR cursor;
int pivot_num;
PIVOT pivot[100];
int line_num;
LINE line[100];
v2i turn(v2i ref, v2i pt, int dir);
bool in_arc_test(v2i ref, v2i orgin, v2i turn, v2i test, int dir);
bool point_on_line(LINE _line, v2i _p);
bool point_on_middle_line(LINE _line, v2i _p);
bool line_in_line(LINE line_1, LINE line_2);
int fsign(int i);
double add_2pi(double ang);
bool check_bound(v2i pt);
};