[Piece] Implement PieceColor ! operator

This commit is contained in:
2022-12-16 18:38:22 +01:00
parent 9f05ab03c1
commit dd7b9f009b
3 changed files with 10 additions and 9 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@
/build*/ /build*/
__pycache__/ __pycache__/
uci-log.txt uci-log.txt
cmake-build-debug
cmake-build-release

View File

@@ -21,18 +21,17 @@ PieceType Piece::type() const {
return PieceType::Pawn; return PieceType::Pawn;
} }
bool operator==(const Piece& lhs, const Piece& rhs) { bool operator==(const Piece &lhs, const Piece &rhs) {
(void)lhs; (void) lhs;
(void)rhs; (void) rhs;
return false; return false;
} }
std::ostream& operator<<(std::ostream& os, const Piece& piece) { std::ostream &operator<<(std::ostream &os, const Piece &piece) {
(void)piece; (void) piece;
return os; return os;
} }
PieceColor operator!(PieceColor color) { PieceColor operator!(PieceColor color) {
(void)color; return static_cast<PieceColor>((static_cast<int>(color) + 1) % 2);
return PieceColor::White;
} }

View File

@@ -5,8 +5,8 @@
#include <iosfwd> #include <iosfwd>
enum class PieceColor { enum class PieceColor {
White, White = 0,
Black Black = 1,
}; };
enum class PieceType { enum class PieceType {