Clean up per-game rules and scoring guide - #92
Merged
Conversation
the scoring footnote showed klondike's 1-card/3-card time bonus text under every variant. move all guide copy into GameGuide keyed by variant, state each game's actual bonus, add hasSelectableDrawMode so only-klondike-has- draw-modes lives in one place, rename the view to GameGuideView, fill klondike's missing rules, and add tests that hold the copy to the engine's behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
GameGuidetype keyed byGameVariant, and renamedRulesAndScoringViewtoGameGuideView. The on-screen title stays "Rules & Scoring".GameVariant.hasSelectableDrawMode(true only for Klondike) and pointedsupportsDrawModeat it, so the capability has a single definition usable outside a live session.GameGuideTests: draw-mode language may appear only in Klondike's guide, every mode's advertised win bonus is checked against a live session's actual bonus, Golf's stroke scoring is asserted, plus content-integrity checks.Why
The scoring footer was hardcoded for Klondike and rendered for every variant, so each game's guide described a 1-card/3-card draw choice that only Klondike has. Extracting the copy into a testable type and tying the advertised numbers to the engine keeps any variant's guide from describing another game's mechanics again.
Validation
ComputerSolitaireTeststarget passes on macOS (592 tests) on this exact diff.GameGuideTests(8 tests) pass, including the session-parity check that deals everyGameModeand compares its realwinTimeMaxBonusto the guide's advertised value.UI Changes
Text-only. The Scoring tab's fine print for FreeCell, Spider, Yukon, Pyramid, TriPeaks, Forty Thieves, Canfield, and Scorpion now describes each game's actual time bonus instead of Klondike's draw modes, and the Rules tab copy edits above. No layout or behavior changes.