fix(core): make take_from_foundation true by default across all clients
Build and Deploy / build-and-push (push) Successful in 3m51s
Android Release / build-apk (push) Successful in 4m36s

The flag was modelled as an opt-in non-standard rule but moving a card
off a foundation is in fact standard Klondike — disabling it is the
non-standard variant.

Changing the core default to true means every client (desktop, Android,
web) gets correct behaviour without each having to independently patch
the value after construction. Clients that expose a settings toggle
(desktop/Android) can still disable it through SettingsResource.

- game_state.rs: flip default from false → true in new_with_mode
- game_state.rs: rename/update take_from_foundation_disabled_by_default
  test to reflect the new intended default
- solitaire_wasm/lib.rs: remove now-redundant override in new()
  (from_saved keeps its override to fix old saves that serialised false)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-19 15:44:04 -07:00
parent b5a780ddf4
commit f6e7de1093
2 changed files with 6 additions and 7 deletions
+3 -4
View File
@@ -366,10 +366,9 @@ impl SolitaireGame {
} else {
DrawMode::DrawOne
};
let mut game = GameState::new_with_mode(seed as u64, dm, GameMode::Classic);
// The web client has no settings layer; enable standard Klondike rule unconditionally.
game.take_from_foundation = true;
SolitaireGame { game }
SolitaireGame {
game: GameState::new_with_mode(seed as u64, dm, GameMode::Classic),
}
}
/// Full pile snapshot as a JS object.