mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
chore: remove pawns_positions vector
This commit is contained in:
@@ -5,7 +5,6 @@ use log::{debug, info, warn};
|
||||
|
||||
pub struct Board {
|
||||
board: Vec<Field>,
|
||||
pawns_positions: Vec<Position>,
|
||||
pub size: usize,
|
||||
}
|
||||
|
||||
@@ -56,16 +55,7 @@ impl Board {
|
||||
})
|
||||
.collect();
|
||||
|
||||
let pawns_positions: Vec<Position> = board
|
||||
.iter()
|
||||
.filter_map(|field| field.pawn.as_ref().map(|_| field.position))
|
||||
.collect();
|
||||
|
||||
Board {
|
||||
board,
|
||||
size,
|
||||
pawns_positions,
|
||||
}
|
||||
Board { board, size }
|
||||
}
|
||||
|
||||
/// Checks if move from position to position is valid.
|
||||
|
||||
Reference in New Issue
Block a user