feat(engine): surface upstream move-type counters and replay seek
Test / test (pull_request) Successful in 36m35s
Test / test (pull_request) Successful in 36m35s
Two unused-for-free upstream card_game/klondike features: - GameState now exposes the granular KlondikeStats counters (move_to_foundation_count, move_to_tableau_count, move_from_foundation_count, flip_up_count) and the win modal shows a quiet per-move-type recap line built from them (e.g. "21 to foundation - 14 tableau moves - 9 flips") - wasm ReplayPlayer gains seek(step): clamped jump to any position, rewinding via a stored copy of the recorded deal instead of reparsing the replay JSON; replay.js Prev now uses it Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -461,6 +461,32 @@ impl GameState {
|
||||
self.session.stats().stats().recycle_count()
|
||||
}
|
||||
|
||||
/// Number of cards moved onto foundations this game, read from the
|
||||
/// upstream session stats. Cumulative like [`Self::recycle_count`] —
|
||||
/// not rolled back on undo.
|
||||
pub fn move_to_foundation_count(&self) -> u32 {
|
||||
self.session.stats().stats().move_to_foundation_count()
|
||||
}
|
||||
|
||||
/// Number of stacks moved onto tableaus (from stock or another tableau)
|
||||
/// this game, read from the upstream session stats. Cumulative — not
|
||||
/// rolled back on undo.
|
||||
pub fn move_to_tableau_count(&self) -> u32 {
|
||||
self.session.stats().stats().move_to_tableau_count()
|
||||
}
|
||||
|
||||
/// Number of cards taken back off a foundation this game, read from the
|
||||
/// upstream session stats. Cumulative — not rolled back on undo.
|
||||
pub fn move_from_foundation_count(&self) -> u32 {
|
||||
self.session.stats().stats().move_from_foundation_count()
|
||||
}
|
||||
|
||||
/// Number of face-down cards revealed (flipped up) this game, read from
|
||||
/// the upstream session stats. Cumulative — not rolled back on undo.
|
||||
pub fn flip_up_count(&self) -> u32 {
|
||||
self.session.stats().stats().flip_up_bonus_count()
|
||||
}
|
||||
|
||||
/// Total moves made this game (draws, recycles, and card moves), derived
|
||||
/// from the session's instruction history length.
|
||||
pub fn move_count(&self) -> u32 {
|
||||
|
||||
Reference in New Issue
Block a user