refactor(core,engine,wasm): canonical FOUNDATIONS/TABLEAUS consts; adopt upstream SUITS/RANKS #137

Merged
funman300 merged 1 commits from refactor/quat-enum-consts into master 2026-07-07 03:05:11 +00:00
Owner

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 no Foundation::ALL; inherent impls can't be added to foreign types). Removes 3 identical private helper copies + 2 hand-enumerations.
  • Upstream Suit::SUITS / Rank::RANKS adopted everywhere; the order-sensitive CardImageSet texture indexing is re-keyed through canonical suit_index/rank_index helpers with regression tests pinning them to upstream order.

Net −177 lines. Gates: clippy --all-targets -D warnings clean, cargo test --workspace green, cargo check -p solitaire_wasm --target wasm32-unknown-unknown clean. 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): one canonical enumeration source instead of five scattered copies. - `solitaire_core::{FOUNDATIONS, TABLEAUS}` — canonical pile-enum iteration (upstream has no `Foundation::ALL`; inherent impls can't be added to foreign types). Removes 3 identical private helper copies + 2 hand-enumerations. - Upstream `Suit::SUITS` / `Rank::RANKS` adopted everywhere; the order-sensitive `CardImageSet` texture indexing is re-keyed through canonical `suit_index`/`rank_index` helpers with regression tests pinning them to upstream order. **Net −177 lines.** Gates: clippy `--all-targets -D warnings` clean, `cargo test --workspace` green, `cargo check -p solitaire_wasm --target wasm32-unknown-unknown` clean. Implemented by a session agent; gates re-run and diff reviewed by the main session. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 1 commit 2026-07-07 02:58:34 +00:00
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>
funman300 merged commit b2341c652b into master 2026-07-07 03:05:11 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#137