Repository navigation
Build creature tokens through one helper - #470
Merged
Merged
Conversation
Nine places in Game and TextParser spelled out the same nine-key card array for a creature token. Tokens::creature() now builds it; the arrays produced are identical, key for key. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WTP2SqPTWy8sMSFHkDL2C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Val · project thread
Item 5 of the structural review: token catalog.
What changed
Nine places spelled out the same nine-key card array for a creature token: Fish, Warrior, Rebel, Phyrexian Germ, Spirit, the Incubator's Phyrexian back face, Hero and Servo in
Game, and the parsed "create a 2/2 red Goblin creature token" case inTextParser.Tokens::creature()now builds that array. The result is identical key for key, so saved games and token behavior are unchanged.Smaller than estimated
The review counted 19 inline token arrays. On a closer look the seven artifact tokens (Food, Clue, Treasure, …) are already one table in
TextParser, and the Incubator front face, Jace and theOptionalChoicesGoblin (a constant, which cannot call a function) are one-offs left as they are. This is a readability change more than a size change: lines get shorter, but with the new file's doc comments the total is slightly up.Verification
Full suite locally: 2591 tests, 2 skipped (the existing missing-import skips). Pint clean. Pins for
Game.phpandTextParser.phprefreshed withcomposer pins.Generated by Claude Code