[Move] Fix streaming with promotion
This commit is contained in:
3
Move.cpp
3
Move.cpp
@@ -1,6 +1,7 @@
|
||||
#include "Move.hpp"
|
||||
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
|
||||
Move::Move(const Square &from, const Square &to, const std::optional<PieceType> &promotion)
|
||||
: mFrom(from), mTo(to), mPromotion(promotion) {
|
||||
@@ -41,7 +42,7 @@ std::optional<PieceType> Move::promotion() const {
|
||||
std::ostream &operator<<(std::ostream &os, const Move &move) {
|
||||
os << move.from() << move.to();
|
||||
if (move.promotion().has_value()) {
|
||||
os << static_cast<char>(move.promotion().value());
|
||||
os << move.promotion().value();
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
Reference in New Issue
Block a user