WIP
This commit is contained in:
parent
d5cdf273c8
commit
091cc99cb3
42 changed files with 805 additions and 1662 deletions
|
@ -1,34 +1,19 @@
|
|||
// Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! board {
|
||||
[$($color:ident $shape:ident on $square:ident),* $(,)?] => {
|
||||
$crate::Builder::new()
|
||||
$(.place_piece(
|
||||
chessfriend_core::PlacedPiece::new(
|
||||
chessfriend_core::Piece::new(
|
||||
chessfriend_core::Color::$color,
|
||||
chessfriend_core::Shape::$shape),
|
||||
chessfriend_core::Square::$square
|
||||
)
|
||||
))*
|
||||
.build()
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! test_board {
|
||||
($to_move:ident, [ $($color:ident $shape:ident on $square:ident),* $(,)? ], $en_passant:ident) => {
|
||||
{
|
||||
let mut board = $crate::Board::empty();
|
||||
$(let _ = board.pieces.place(
|
||||
$(let _ = board.place_piece(
|
||||
chessfriend_core::Piece::new(
|
||||
chessfriend_core::Color::$color,
|
||||
chessfriend_core::Shape::$shape
|
||||
),
|
||||
chessfriend_core::Square::$square);
|
||||
chessfriend_core::Square::$square,
|
||||
$crate::PlacePieceStrategy::default());
|
||||
)*
|
||||
board.clock.active_color = chessfriend_core::Color::$to_move;
|
||||
board.active_color = chessfriend_core::Color::$to_move;
|
||||
board.en_passant_target = Some(chessfriend_core::Square::$en_passant);
|
||||
|
||||
println!("{}", board.display());
|
||||
|
@ -39,7 +24,7 @@ macro_rules! test_board {
|
|||
($to_move:ident, [ $($color:ident $shape:ident on $square:ident),* $(,)? ]) => {
|
||||
{
|
||||
let mut board = $crate::Board::empty();
|
||||
$(let _ = board.pieces.place(
|
||||
$(let _ = board.place_piece(
|
||||
chessfriend_core::Piece::new(
|
||||
chessfriend_core::Color::$color,
|
||||
chessfriend_core::Shape::$shape
|
||||
|
@ -47,7 +32,7 @@ macro_rules! test_board {
|
|||
chessfriend_core::Square::$square,
|
||||
$crate::PlacePieceStrategy::default());
|
||||
)*
|
||||
board.clock.active_color = chessfriend_core::Color::$to_move;
|
||||
board.active_color = chessfriend_core::Color::$to_move;
|
||||
|
||||
println!("{}", board.display());
|
||||
|
||||
|
@ -57,7 +42,7 @@ macro_rules! test_board {
|
|||
($($color:ident $shape:ident on $square:ident),* $(,)?) => {
|
||||
{
|
||||
let mut board = $crate::Board::empty();
|
||||
$(let _ = board.pieces.place(
|
||||
$(let _ = board.place_piece(
|
||||
chessfriend_core::Piece::new(
|
||||
chessfriend_core::Color::$color,
|
||||
chessfriend_core::Shape::$shape
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue