added UnmakeMove function to unmake the last move
This commit is contained in:
1 parent
025ae1eceb
commit
8535042c04
3 files changed
+102
-6
No files matched your search
@@ -31,4 +31,32 @@ public:
|
||||
std::cout << squareCoords[moveFrom] << squareCoords[moveTo];
|
||||
std::cout << '(' << moveTypes[moveFlags] << ")\n";
|
||||
}
|
||||
};
|
||||
|
||||
struct LastMove {
|
||||
public:
|
||||
int moveFrom;
|
||||
int moveTo;
|
||||
uint16_t moveFlags;
|
||||
|
||||
int attackerPiece;
|
||||
int capturedPiece;
|
||||
int capturedColor;
|
||||
int enPassantTarget;
|
||||
std::array<bool, 4> castlingRights;
|
||||
|
||||
LastMove(){}
|
||||
LastMove(const Move move, const int capturedPiece,
|
||||
const int capturedColor, const int enPassantTarget,
|
||||
const std::array<bool, 4> castlingRights, int attackerPiece) {
|
||||
moveFrom = move.moveFrom;
|
||||
moveTo = move.moveTo;
|
||||
moveFlags = move.moveFlags;
|
||||
|
||||
LastMove::capturedPiece = capturedPiece;
|
||||
LastMove::capturedColor = capturedColor;
|
||||
LastMove::enPassantTarget = enPassantTarget;
|
||||
LastMove::castlingRights = castlingRights;
|
||||
LastMove::attackerPiece = attackerPiece;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user