-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmove.h
64 lines (54 loc) · 1.17 KB
/
move.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
#include <cstdbool>
#include "enums.h"
#ifndef MOVE_H
#define MOVE_H
class DeploymentMove {
public:
char x;
char y;
Piece piece;
DeploymentMove(char move_x, char move_y, Piece move_piece) {
x = move_x;
y = move_y;
piece = move_piece;
}
DeploymentMove() {
x = 0;
y = 0;
piece = nopiece;
}
};
class Move {
public:
char x;
char y;
char dx;
char dy;
bool resign;
Move(char _x, char _y, char _dx, char _dy) {
x = _x;
y = _y;
dx = _dx;
dy = _dy;
resign = false;
}
Move(bool _resign) {
x = 0;
y = 0;
dx = 0;
dy = 0;
resign = _resign;
}
Move() {
//Null move
x = 0;
y = 0;
dx = 0;
dy = 0;
resign = false;
}
bool equals(Move* other) {
return x == other->x && y == other->y && dx == other->dx && dy == other->dy && resign == other->resign;
}
};
#endif