[Piece] Add fromValue
This commit is contained in:
@@ -42,6 +42,9 @@ std::optional<PieceType> Piece::pieceTypeFromSymbol(char symbol) {
|
||||
default: return std::nullopt;
|
||||
}
|
||||
}
|
||||
Piece::Optional Piece::fromValue(unsigned int value) {
|
||||
return Piece(valToColor(value), valToType(value));
|
||||
}
|
||||
|
||||
bool operator==(const Piece &lhs, const Piece &rhs) {
|
||||
return lhs.color() == rhs.color() && lhs.type() == rhs.type();
|
||||
|
Reference in New Issue
Block a user