For example, let's say in total there may be 5 cards that are in the game, let's use:
Axe-thrower (3-cost, Creature, 5 Power, 3 Defense, Rush ability)
Ice Elemental (2-cost, Creature, 2 Power, 5 Defense, Crystalized ability)
Party Trick (3-cost, Spell, Swap the Power and defense of a single creature)
Blademaster (3-cost, Creature, 3 Power, 3 Defense, Gains +1/+1 for every other creature on the field)
Minefield (3-cost, Trap, Deal X damage to all enemies, where X is the number of creatures on the opponent's side of the field)
With those in mind, some have default values, which would be simple to store in the database, some would likely remain as 0's or another default value until their effects came into play, etc. Simple enough.
My question is more about how to handle the cards and their values once they're in decks, a player's hand, and on the field.
The Axe-Thrower is a 5/3 creature, but let's say it's buffed in some fashion - how am I differentiating an object which is the base version of a card, version the version which is modified in some way? The only values stored in the DB Would be the base values, not the modified ones, correct? Unless there was some kind of suspend functionality in which case I would have to track the modified values as well.
My initial thought of an implementation, at least for the Database side of things was as follows:
Cards (ID, Name) -- Base card
CardVersions (ID, CardID, Version, ImagePath, CardStatsID) -- Cards' stats dependent on version
CardStats (ID, Cost, Power, Defense) -- Stats for a given CardVersion
Now those would be the "base" cards, the following could be how the specific instances are handled?:
PlayerCards (ID, PlayerID, CardID, Count) -- Player's cards
Decks (ID, PlayerID, Name) -- Player's decks
DeckCards (ID, DeckID, PlayerCardID, Count) -- How many of a card in a given deck
Which is a decent start, I think, for the cards in a player's deck.
For the cards in a player's hand / on their field, would those all simply be references to the PlayerCards with objects that have modifiable versions of the stats? For example, a GameCard with Original Stats and Modified Stats, where the majority of the time, the Modified Stats will be the Original Stats to start, but will change as the cards are buffed or their abilities are invoked?
Am I missing a super-simple solution to this, what I would imagine, common case for TCGs?