[DevEx]: Refactor Card Selection
Feature Summary
Card selection should be refactored to remove the use of indices
Detailed Description
Currently card selection is a combination of an index variable, computed properties, and data about whether you're interacting with the deck or your hand.
In order to prep for #87 , we should refactor selection to make it more generalizable. A cleaner approach would likely be to have two pieces of data:
-
selectedCard: the actual card object being selected -
selectedArea: the place the card was selected from. This could be an enum to specify the valid sources e.g.SelectedArea.PLAYER_HANDorSelectedArea.OPPONENT_POINTS
These could then be used in various computed properties as necessary to determine whether moves are playable with the selected card, or to simply display move choices for cards that the player cannot themselves play (because they are already in play, or in the opponent hand, for example)
Hi, I apply fro issue #621 but I can take this one either. I would like to help and start contributing with cuttle