[Piece] Implement PieceColor ! operator

This commit is contained in:
2022-12-18 16:39:33 +01:00
parent 9f05ab03c1
commit dd7b9f009b
3 changed files with 10 additions and 9 deletions
+2
View File
@@ -2,3 +2,5 @@
/build*/ /build*/
__pycache__/ __pycache__/
uci-log.txt uci-log.txt
cmake-build-debug
cmake-build-release
+6 -7
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;
} }
+2 -2
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 {