-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMove.h
executable file
·68 lines (46 loc) · 1.4 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
65
66
67
68
#ifndef _MOVE_H_
#define _MOVE_H_
#include "types.h"
using namespace std;
class Move {
public:
int fromRow;
int fromCol;
int toRow;
int toCol;
bool isSpecial;
spec_move_t special; // in case it's a special move, which one
piece_t promotionTo; // in case it's a promotion, to what
Position *pos;
bool hashFlag;
// default constructor
Move();
// constructor
Move(int fromRow, int fromCol, int toRow, int toCol);
// special move constructor
Move(int fromRow, int fromCol, int toRow, int toCol, spec_move_t special);
// promotion constructor
Move(int fromRow, int fromCol, int toRow, int toCol, piece_t promotionTo);
// copy constructor
Move(const Move &m);
// = operator
Move& operator =(const Move &m);
// build move from a string
Move(string str);
// == operator
bool operator ==(const Move &m);
// destructor
~Move();
// set the position this move belongs to
void setPosition(Position *p);
// test if this move is forcing (for sorting)
bool isForcing() const;
// test if this move is a capture
bool isCapture() const;
// for debugging purposes
string toString() const;
private:
// initializes members (called in constructors)
void init(int fromRow, int fromCol, int toRow, int toCol);
};
#endif