This commit is contained in:
2026-06-21 22:04:10 -05:00
parent 475534f7c4
commit 87979ac610
7 changed files with 134 additions and 255 deletions
+3 -4
View File
@@ -308,10 +308,9 @@ impl GameState {
board.push(x as usize, y as usize, dir);
}
}
// apply_swap reads all sources then writes all destinations, so a
// whole batch of moves resolves simultaneously (cycles included).
Action::Swap(pairs) => {
logs.extend(board.apply_swap(&pairs));
// apply_shift moves the named cells.
Action::Shift(cells) => {
logs.extend(board.apply_shift(&cells));
}
// Accumulated and applied to `self.player_gems` after the borrow drops.
Action::AddGems(n) => gem_delta += n,