[Move] Implement << operator
This commit is contained in:
5
Move.cpp
5
Move.cpp
@@ -39,7 +39,10 @@ std::optional<PieceType> Move::promotion() const {
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os, const Move &move) {
|
||||
(void) move;
|
||||
os << move.from() << move.to();
|
||||
if (move.promotion().has_value()) {
|
||||
os << static_cast<char>(move.promotion().value());
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user