Add additional debug prints.

This commit is contained in:
yukirij 2024-10-18 00:59:07 -07:00
parent 694a5274f6
commit 9daed4500b

View File

@ -337,9 +337,12 @@ impl Game {
2 => {
if let Some(piece_id) = self.board.tiles[play.from as usize].piece {
println!("A");
if let Some(piece) = &self.board.pieces[piece_id as usize] {
println!("B");
if piece.player == player {
let plays = self.get_alts(piece);
println!("plays {}", plays.len());
for p in plays {
if p.to == play.to {
valid = true;
@ -588,7 +591,9 @@ impl Game {
/*
** Filter valid tiles from allowed.
*/
println!("C2");
if let Some(alt_mode) = piece_moves.alt {
println!("C3 {}", alt_mode);
match alt_mode {
// Knight
1 => {
@ -649,6 +654,7 @@ impl Game {
pub fn get_alts(&self, piece:&Piece) -> Vec<Play>
{
println!("C1");
self.get_alts_data(piece).iter().map(|info| info.play).collect()
}