I’m creating a card game where the cards have special abilities that interact with other cards. At this point I just have simple tables holding cards that don’t have unique identifiers to them, which is causing a lot of issues when I try to execute more advanced functions.
For example, a player may have 20 cards total, with 10 in a discard pile, 5 in his hand, and the other 5 in a draw pile. Playing one of the cards from his hand can remove 2 cards from his discard pile (and out of the game), and remove that particular card (out of the game) as well.
Because I don’t have unique identifiers for each card in the game, I’m running into weird bugs where if I have 2 identical cards in the player hand, both of them will get removed from the game, whether he plays the second card or not.
So my question is, I’m thinking of modifying my cards table to make each card unique, even if there are 5 copies of that card in the game. So card “Trash Card” would be in my cards table 5 times (instead of once) with unique identifiers of “001”, “002”, and so on.
Does it make sense to do something like that, or would it be better to attach a unique identifier to the cards only once they’re in a player’s card deck? So for example the “Trash Card” would only be in the cards table once, but if a player acquires multiple copies of it, they would have unique identifiers at that point.
I hope this makes any sense at all. I’ve run into a lot of road blocks on this game due to multiple cards being indistinguishable from each other once they’re in a table.
Thanks in advance for any advice!