From 0d5c9cdb1d3ebd2d597792679340ed1d0d4a99b4 Mon Sep 17 00:00:00 2001 From: funman300 Date: Fri, 12 Jun 2026 14:22:35 -0700 Subject: [PATCH] refactor(core): delegate check_win to Session::is_win check_win() manually projected through session.state().state().is_win(), reaching the inner Klondike's is_win. Session::is_win() (card_game 0.4.1) wraps that exact same projection, so collapse the three-hop reach into a single-hop delegation. check_auto_complete() keeps its projection because is_win_trivial() is a Klondike-only method with no Session wrapper. Behavior is bit-for-bit identical; the test-support override in is_won()/is_auto_completable() (which call check_win) is untouched. Co-Authored-By: Claude Opus 4.8 (1M context) --- solitaire_core/src/game_state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solitaire_core/src/game_state.rs b/solitaire_core/src/game_state.rs index 4691d32..13e39f3 100644 --- a/solitaire_core/src/game_state.rs +++ b/solitaire_core/src/game_state.rs @@ -969,7 +969,7 @@ impl GameState { /// Returns `true` when all four foundation slots each contain a complete A→K sequence. pub fn check_win(&self) -> bool { - self.session.state().state().is_win() + self.session.is_win() } /// Returns `true` when the game can be completed without further player input