|
|
|
@ -1471,7 +1471,14 @@ fn handle_restart(mut game_state: ResMut<NextState<GameState>>) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn assert_piece_consistency(
|
|
|
|
fn assert_piece_consistency(
|
|
|
|
query: Query<Entity, (With<Piece>, Or<(With<BoardIndex>, With<BeingCaptured>, With<Captured>)>)>
|
|
|
|
active: Query<Entity, (With<Piece>, With<BoardIndex>)>,
|
|
|
|
|
|
|
|
being_captured: Query<Entity, (With<Piece>, With<BeingCaptured>)>,
|
|
|
|
|
|
|
|
captured: Query<Entity, (With<Piece>, With<Captured>)>,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
assert_eq!(query.iter().len(), 18, "Pieces does does not add up!");
|
|
|
|
let active_count = active.iter().len();
|
|
|
|
|
|
|
|
let being_captured_count = being_captured.iter().len();
|
|
|
|
|
|
|
|
let captured_count = captured.iter().len();
|
|
|
|
|
|
|
|
info!("Active: {} | being captured: {} | captured: {}", active_count, being_captured_count, captured_count);
|
|
|
|
|
|
|
|
let total_count = active_count + being_captured_count + captured_count;
|
|
|
|
|
|
|
|
assert_eq!(total_count, 18, "Pieces does does not add up!");
|
|
|
|
}
|
|
|
|
}
|