-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMove.cc
More file actions
50 lines (38 loc) · 1.13 KB
/
Move.cc
File metadata and controls
50 lines (38 loc) · 1.13 KB
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
#include <utility>
#include "Move.h"
using namespace std;
Move::Move(Piece* movedPiece, pair<int, int> startPos, pair<int,int> endPos, Piece* capturedPiece) : // for regular moves
movedPiece{movedPiece},
startPos{startPos},
endPos{endPos},
capturedPiece{capturedPiece},
isCastleK{false},
isCastleQ{false},
isPromoting{false},
isEP{false}{}
Move::Move(Piece* movedPiece, pair<int, int> startPos, pair<int, int> endPos, Piece* capturedPiece, bool isCastleK, bool isCastleQ, bool isPromoting, char promoteTo, bool isEP) :
movedPiece{movedPiece},
startPos{startPos},
endPos{endPos},
capturedPiece{capturedPiece},
isCastleK{isCastleK},
isCastleQ{isCastleQ},
isPromoting{isPromoting},
isEP{isEP} {}
Piece* Move::getMovedPiece(){
return movedPiece;
}
pair<int, int> Move::getStartPos(){
return startPos;
}
pair<int, int> Move::getEndPos(){
return endPos;
}
Piece* Move::getCapturedPiece(){
return capturedPiece;
}
bool Move::isPotentialKSCastle() { return isCastleK; }
bool Move::isPotentialQSCastle() { return isCastleQ; }
bool Move::getIsEP(){
return isEP;
}