refactor(engine): deduplicate TABLEAU_FAN_FRAC constant shared between layout.rs and card_plugin.rs #59
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Problem
TABLEAU_FAN_FRAC = 0.18is defined in two places:solitaire_engine/src/layout.rs(line 78)solitaire_engine/src/card_plugin.rs(line 46, with a comment saying the two values must stay in sync)Requiring manual synchronisation of the same constant is fragile — they will inevitably drift.
Fix
Define
TABLEAU_FAN_FRAConce inlayout.rs(or a sharedconstants.rs) and import it incard_plugin.rs:Remove the duplicate definition and the sync-comment.