add simulated place function to the board
This commit is contained in:
parent
2c93b47630
commit
0f2190ad31
1 changed files with 6 additions and 0 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue