CardGame
Rogue-like card videogame
Loading...
Searching...
No Matches
CardInstance Class Reference

Represents a runtime instance of a card during combat. More...

#include <cardInstance.h>

Collaboration diagram for CardInstance:

Public Member Functions

 CardInstance (const CardDefinition &definition)
 Constructs a CardInstance from a CardDefinition.
 
int getDamage () const
 Returns the card's current damage value.
 
int getArmor () const
 Returns the card's current armor value.
 
const CardDefinitiongetCardDefinition () const
 Returns the immutable definition this instance was created from.
 
const CardParamsgetCardParams () const
 

Detailed Description

Represents a runtime instance of a card during combat.

CardInstance holds temporary state used in a single combat:

Used for tracking temporary buffs, debuffs, or cost changes. CardInstances are created at combat start and destroyed at combat end.

Constructor & Destructor Documentation

◆ CardInstance()

CardInstance::CardInstance ( const CardDefinition definition)

Constructs a CardInstance from a CardDefinition.

Copies base values (damage, armor, cost) from the definition.

Parameters
definitionImmutable reference to the source CardDefinition.

Member Function Documentation

◆ getArmor()

int CardInstance::getArmor ( ) const
inline

Returns the card's current armor value.

◆ getCardDefinition()

const CardDefinition & CardInstance::getCardDefinition ( ) const

Returns the immutable definition this instance was created from.

Used for name, ID, effect list, and base values.

◆ getCardParams()

const CardParams & CardInstance::getCardParams ( ) const

◆ getDamage()

int CardInstance::getDamage ( ) const
inline

Returns the card's current damage value.


The documentation for this class was generated from the following files: