refactor(core): card_game redundancy cleanup + derive scoring from upstream stats #88
Reference in New Issue
Block a user
Delete Branch "refactor/strip-card_game-redundancies"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Finishes the
card_game/klondikemigration and the post-migration cleanup. Four substantive strands on this branch:GameState's hand-rolled WXP scoring state replaced by values derived from the upstream session stats (unblocked bycard_game 0.4.1/klondike 0.4.0).CardEntityIndexperf — engine drag card→entity lookups moved from O(n) query scans to an O(1) index.solitaire_data::solverremoved; solving goes throughcard_game::Session::solve()via a core domain method.Changes
Redundancy cleanup
GameState::compute_time_bonusload_latest_replay_from/save_latest_replay_tore-exportsXpBreakdownklondike_adapter::foundation_from_slotScoring migration —
372b642(closes #84, #86, #87)GameStatefieldsscore/undo_count/recycle_count(#87), thescore_history/is_recycle_historyundo journal (#86), andKlondikeAdapter::apply_undo_score+score_for_*+pre_instruction_score_delta(#84)score()/undo_count()/recycle_count()readingsession.stats(); −15 undo penalty nowSessionConfig::undo_penaltyrecycle_countcumulative;undo_countresets across save/loadCardEntityIndex perf —
424c8b2follow_drag,end_drag,touch_*,update_drag_shadow) throughCardEntityIndex(O(1)HashMap) instead ofQuery::iter().find()— each previously ran per dragged card per frameInputPlugindefensivelyinit_resource::<CardEntityIndex>()(idempotent) so it is self-sufficient in testsSolver wrapper deletion —
e841a7asolitaire_data::solvermodule; its shaping (build a solve-budgetedSession, runcard_game::Session::solve(), extract the first useful move) moves onto the domain type asGameState::solve_first_move()/solve_fresh_deal()insolitaire_core, with the budget consts +SolveOutcomere-exported from coreGameState) is its correct home;solitaire_datais the persistence layerVerification
cargo test --workspace(all crates green) andcargo clippy --workspace --all-targets -- -D warningsclean.🤖 Generated with Claude Code
refactor: remove leftover redundancies after card_game migrationto refactor(core): card_game redundancy cleanup + derive scoring from upstream stats