add simulated place function to the board

This commit is contained in:
Noa Aarts 2025-12-05 20:42:22 +01:00
parent 2c93b47630
commit 0f2190ad31
Signed by: noa
GPG key ID: 1850932741EFF672

View file

@ -230,6 +230,12 @@ mod game {
})
}
fn sim_place(&self, tile: Tile, pos: (usize, usize), player: Player) -> Self {
let mut other = self.clone();
other.place(tile, pos, player);
other
}
fn place(&mut self, tile: Tile, pos: (usize, usize), player: Player) {
let (x, y) = pos;
for &(i, j) in tile.parts.iter() {