introduced move types
This commit is contained in:
1 parent
06b50a4033
commit
effefd1aba
2 files changed
+101
-20
No files matched your search
+25
-5
@@ -1,15 +1,35 @@
|
||||
#pragma once
|
||||
#include "bitboards.h"
|
||||
|
||||
enum MOVE_FLAGS {
|
||||
quiet, doublePawnPush,
|
||||
kingCastle, QueenCastle,
|
||||
capture, epCapture,
|
||||
knightPromotion, bishopPromotion, rookPromotion, queenPromotion,
|
||||
knightPromoCapture, bishopPromoCapture, rookPromoCapture, queenPromoCapture
|
||||
};
|
||||
|
||||
constexpr std::array<const char*, 14> moveTypes {
|
||||
"quiet", "doublePawnPush",
|
||||
"kingCastle", "QueenCastle",
|
||||
"capture", "epCapture",
|
||||
"knightPromotion", "bishopPromotion", "rookPromotion", "queenPromotion",
|
||||
"knightPromoCapture", "bishopPromoCapture", "rookPromoCapture", "queenPromoCapture"
|
||||
};
|
||||
|
||||
struct Move {
|
||||
public:
|
||||
SQUARE moveFrom;
|
||||
SQUARE moveTo;
|
||||
int moveFrom;
|
||||
int moveTo;
|
||||
uint16_t moveFlags;
|
||||
|
||||
Move(){}
|
||||
|
||||
Move(const SQUARE from, const SQUARE to)
|
||||
: moveFrom(from), moveTo(to) {}
|
||||
Move(const int from, const int to, const uint16_t flags)
|
||||
: moveFrom(from), moveTo(to), moveFlags(flags) {}
|
||||
|
||||
void PrintMove();
|
||||
void PrintMove() {
|
||||
std::cout << squareCoords[moveFrom] << squareCoords[moveTo];
|
||||
std::cout << '(' << moveTypes[moveFlags] << ")\n";
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user