1.2 KiB
1.2 KiB
Update Deck Auto-Fill Logic
Request
The user requested that the "Auto-Fill" (Add Lands) button in the Deck Builder behave exactly like clicking individual lands in the Land Station. Specifically, lands should be added as individual card entries in the deck list so they can be viewed and removed one by one, rather than just updating a counter.
Implementation Plan
- Modify
applySuggestionfunction insrc/client/src/modules/draft/DeckBuilderView.tsx. - Check if
availableBasicLandsis populated (indicating the graphical Land Station is active). - If active, iterate through the suggested land counts.
- For each count, find the corresponding land card object in
availableBasicLands. - Generate unique card objects (with unique IDs) for each land instance, replicating the logic of
addLandToDeck. - Add these new land objects to the
deckstate. - Retain the old counter-based logic as a fallback if
availableBasicLandsis empty.
Status
- Analyzed
DeckBuilderView.tsxto understand currentapplySuggestionvsaddLandToDecklogic. - Refactored
applySuggestionto implement the new behavior. - Verified ID generation and state updates match existing patterns.