-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMove.h
More file actions
34 lines (30 loc) · 1010 Bytes
/
Move.h
File metadata and controls
34 lines (30 loc) · 1010 Bytes
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
#ifndef MOVE_H
#define MOVE_H
#include <utility>
#include "Piece.h"
using namespace std;
class Move {
private:
Piece* movedPiece;
pair<int,int> startPos;
pair<int, int> endPos;
Piece* capturedPiece;
bool isCastleK;
bool isCastleQ;
bool isPromoting;
char promoteTo;
bool isEP;
public:
// two ctors: one for regular moves and one for "special" things like castling, promotion, etc.
// regular move ctor will set all the stuff as false
Move(Piece* movedPiece, pair<int, int> startPos, pair<int,int> endPos, Piece* capturedPiece = nullptr);
Move(Piece* movedPiece, pair<int, int> startPos, pair<int,int> endPos, Piece* capturedPiece, bool isCastleK, bool isCastleQ, bool isPromoting, char promoteTo, bool isEP);
Piece * getMovedPiece();
pair<int, int> getStartPos();
pair<int, int> getEndPos();
Piece* getCapturedPiece();
bool isPotentialKSCastle();
bool isPotentialQSCastle();
bool getIsEP();
};
#endif