Remove counts from GameState #87

Closed
opened 2026-06-11 03:17:14 +00:00 by Quaternions · 1 comment

Remove the following fields from solitaire_core/src/klondike_adapter.rs GameState:

    pub score: i32,
    pub undo_count: u32,
    pub recycle_count: u32,

They are tracked in SessionStats and KlondikeStats and do not need to be duplicated.

Remove the following fields from solitaire_core/src/klondike_adapter.rs GameState: ``` pub score: i32, pub undo_count: u32, pub recycle_count: u32, ``` They are tracked in SessionStats and KlondikeStats and do not need to be duplicated.
Owner

Resolved in commit 372b642.

The score, undo_count, and recycle_count fields are removed from GameState and replaced by derived accessor methods:

  • recycle_count() -> KlondikeStats::recycle_count()
  • undo_count() -> SessionStats::undos()
  • score() -> upstream SessionState::score(stats, config), floored at 0, suppressed in Zen

Two intentional semantic shifts: recycle_count is now cumulative (upstream never decrements it on undo, unlike the old net count), and undo_count resets to 0 across a save/load cycle (only the forward instruction history is persisted). Save schema bumped v4 -> v5; the three counters are no longer serialised and are rebuilt by replay on load. Older v3/v4 saves still load (extra keys ignored).

Resolved in commit 372b642. The `score`, `undo_count`, and `recycle_count` fields are removed from `GameState` and replaced by derived accessor methods: - `recycle_count()` -> `KlondikeStats::recycle_count()` - `undo_count()` -> `SessionStats::undos()` - `score()` -> upstream `SessionState::score(stats, config)`, floored at 0, suppressed in Zen Two intentional semantic shifts: `recycle_count` is now *cumulative* (upstream never decrements it on undo, unlike the old net count), and `undo_count` resets to 0 across a save/load cycle (only the forward instruction history is persisted). Save schema bumped v4 -> v5; the three counters are no longer serialised and are rebuilt by replay on load. Older v3/v4 saves still load (extra keys ignored).
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#87