[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*/
__pycache__/
uci-log.txt
cmake-build-debug
cmake-build-release
+6 -7
View File
@@ -21,18 +21,17 @@ PieceType Piece::type() const {
return PieceType::Pawn;
}
bool operator==(const Piece& lhs, const Piece& rhs) {
(void)lhs;
(void)rhs;
bool operator==(const Piece &lhs, const Piece &rhs) {
(void) lhs;
(void) rhs;
return false;
}
std::ostream& operator<<(std::ostream& os, const Piece& piece) {
(void)piece;
std::ostream &operator<<(std::ostream &os, const Piece &piece) {
(void) piece;
return os;
}
PieceColor operator!(PieceColor color) {
(void)color;
return PieceColor::White;
return static_cast<PieceColor>((static_cast<int>(color) + 1) % 2);
}
+2 -2
View File
@@ -5,8 +5,8 @@
#include <iosfwd>
enum class PieceColor {
White,
Black
White = 0,
Black = 1,
};
enum class PieceType {