[Piece] Format

This commit is contained in:
2022-12-18 17:25:08 +01:00
parent 1bbb8a71d9
commit 4bf3f2cec4
2 changed files with 22 additions and 28 deletions

View File

@@ -20,9 +20,6 @@ enum class PieceType {
class Piece {
const PieceColor _color;
const PieceType _type;
public:
using Optional = std::optional<Piece>;
@@ -33,10 +30,14 @@ public:
PieceColor color() const;
PieceType type() const;
private:
const PieceColor mColor;
const PieceType mType;
};
bool operator==(const Piece& lhs, const Piece& rhs);
std::ostream& operator<<(std::ostream& os, const Piece& piece);
bool operator==(const Piece &lhs, const Piece &rhs);
std::ostream &operator<<(std::ostream &os, const Piece &piece);
// Invert a color (White becomes Black and vice versa)
PieceColor operator!(PieceColor color);