refactor(core,engine,wasm): canonical FOUNDATIONS/TABLEAUS consts; adopt upstream SUITS/RANKS #137
Reference in New Issue
Block a user
Delete Branch "refactor/quat-enum-consts"
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?
Review findings 1+2 (Quat-underuse lens): one canonical enumeration source instead of five scattered copies.
solitaire_core::{FOUNDATIONS, TABLEAUS}— canonical pile-enum iteration (upstream has noFoundation::ALL; inherent impls can't be added to foreign types). Removes 3 identical private helper copies + 2 hand-enumerations.Suit::SUITS/Rank::RANKSadopted everywhere; the order-sensitiveCardImageSettexture indexing is re-keyed through canonicalsuit_index/rank_indexhelpers with regression tests pinning them to upstream order.Net −177 lines. Gates: clippy
--all-targets -D warningsclean,cargo test --workspacegreen,cargo check -p solitaire_wasm --target wasm32-unknown-unknownclean. Implemented by a session agent; gates re-run and diff reviewed by the main session.🤖 Generated with Claude Code
Review findings 1+2 (Quat-underuse lens, 2026-07-06): - solitaire_core gains pub const FOUNDATIONS / TABLEAUS — the canonical iteration source for the upstream pile enums (upstream klondike has no Foundation::ALL, and inherent impls cannot be added to foreign types). Deletes three identical private const-fn copies (radial_menu, table_plugin, input_plugin) and the hand-enumerated variants in card_plugin::sync::all_cards and solitaire_wasm. - Hand-rolled [Suit; 4] / [Rank; 13] arrays replaced with upstream Suit::SUITS / Rank::RANKS. The order-sensitive CardImageSet indexing is re-keyed through canonical card_plugin::{suit_index, rank_index} helpers that match upstream order, with regression tests asserting the correspondence — one ordering everywhere instead of three divergent local ones. Net -177 lines. No behaviour change; all consumers go through the canonical helpers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>