feat(core): take-from-foundation house rule
Add `GameState::take_from_foundation` flag (default false). When off, Foundation→Tableau moves are blocked at the core rule layer. When on, the top card of a foundation pile may be moved back to a compatible tableau column (one card at a time). Wire the matching `Settings::take_from_foundation` field through `handle_new_game` so the player's preference applies to every new deal. Four targeted tests cover: blocked-by-default, allowed-when-enabled, illegal-tableau-placement, and count>1 rejection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -490,6 +490,9 @@ fn handle_new_game(
|
||||
let chosen_seed = initial_seed;
|
||||
|
||||
game.0 = GameState::new_with_mode(chosen_seed, draw_mode, mode);
|
||||
if let Some(s) = settings.as_ref() {
|
||||
game.0.take_from_foundation = s.0.take_from_foundation;
|
||||
}
|
||||
// Reset the in-flight replay buffer — a fresh deal starts with
|
||||
// an empty move list. The previously saved replay on disk
|
||||
// (latest_replay.json) is preserved until the player wins again.
|
||||
|
||||
Reference in New Issue
Block a user