[board] Implement fmt::Display for Piece

This commit is contained in:
Eryn Wells 2023-12-26 21:33:00 -07:00
parent ecc1ee85d4
commit 49c5a0b51d

View file

@ -130,6 +130,12 @@ impl Piece {
piece_constructor!(king, King);
}
impl fmt::Display for Piece {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.shape)
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct PlacedPiece {
pub piece: Piece,