[board] Directly use PlacedPiece in the position! macro

Avoids having to also import the piece! macro to use position!.
This commit is contained in:
Eryn Wells 2024-01-27 13:04:22 -08:00
parent e8d7f15a7f
commit 9d25414b97

View file

@ -4,7 +4,14 @@
macro_rules! position {
[$($color:ident $shape:ident on $square:ident),* $(,)?] => {
$crate::PositionBuilder::new()
$(.place_piece(piece!($color $shape on $square)))*
$(.place_piece(
chessfriend_core::PlacedPiece::new(
chessfriend_core::Piece::new(
chessfriend_core::Color::$color,
chessfriend_core::Shape::$shape),
chessfriend_core::Square::$square
)
))*
.build()
};
}