-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMove.h
60 lines (43 loc) · 1.01 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
#pragma once
#include <string>
#include "Constants.h"
#include "Square.h"
namespace chess {
class Square;
class Move
{
public:
//std::string s;
char piece, capturedPiece, promotedTo;
unsigned char srcRow, srcCol, dstRow, dstCol;
char moveFlags;
static const char SHORT_CASTLE = 0x01;
static const char LONG_CASTLE = 0x02;
static const char ENPASSANT = 0x04;
static const char COLOR_WHITE = 0x08;
//bool isShortCastle;
//bool isLongCastle;
//bool isCapture;
//bool isEnpassant;
//Color color;
char score;
Move();
static inline bool isRow(const char& c) {
return ((c >= '1') && (c <= '8'));
}
static inline bool isCol(const char& c) {
return ((c >= 'a') && (c <= 'h'));
}
static inline unsigned getRow(const char& c) {
return (7 - (c - '1'));
}
static inline unsigned getCol(const char& c) {
return (c - 'a');
}
std::string toSAN();
std::string toLAN();
bool fromSAN(const char* str);
bool fromLAN(const char* str);
Move* clone();
};
}