[board] Directly use PlacedPiece in the position! macro
Avoids having to also import the piece! macro to use position!.
This commit is contained in:
parent
e8d7f15a7f
commit
9d25414b97
1 changed files with 8 additions and 1 deletions
|
@ -4,7 +4,14 @@
|
||||||
macro_rules! position {
|
macro_rules! position {
|
||||||
[$($color:ident $shape:ident on $square:ident),* $(,)?] => {
|
[$($color:ident $shape:ident on $square:ident),* $(,)?] => {
|
||||||
$crate::PositionBuilder::new()
|
$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()
|
.build()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue