Abstract entity structure that stores card data. More...

#include <Rosetta/Models/Entity.hpp>

Inheritance diagram for RosettaStone::Entity:
RosettaStone::Character RosettaStone::HeroPower RosettaStone::Spell RosettaStone::Weapon RosettaStone::Hero RosettaStone::Minion

Public Member Functions

 Entity ()=default
 Default constructor. More...
 
 Entity (Player &_owner, Card &_card)
 
virtual ~Entity ()
 Destructor. More...
 
 Entity (const Entity &ent)
 Copy constructor. More...
 
 Entity (Entity &&ent) noexcept
 Move constructor. More...
 
Entityoperator= (const Entity &ent)
 Copy assignment operator. More...
 
Entityoperator= (Entity &&ent) noexcept
 Move assignment operator. More...
 
PlayerGetOwner () const
 
void SetOwner (Player &owner)
 
int GetGameTag (GameTag tag) const
 
virtual void SetGameTag (GameTag tag, int value)
 
virtual void Destroy ()
 Destroys character. More...
 

Static Public Member Functions

static EntityGetFromCard (Player &player, Card &&card)
 

Public Attributes

Card card
 
std::size_t id = 0
 
bool isDestroyed = false
 

Protected Attributes

Playerm_owner = nullptr
 
std::map< GameTag, intm_gameTags
 

Detailed Description

Abstract entity structure that stores card data.

This structure is base structure of all data-holding/action-performing/ visible or invisible objects in a Hearthstone++. An entity is defined as a collection of properties, called GameTags.

Constructor & Destructor Documentation

◆ Entity() [1/4]

RosettaStone::Entity::Entity ( )
default

Default constructor.

◆ Entity() [2/4]

RosettaStone::Entity::Entity ( Player _owner,
Card _card 
)

Constructs entity with given _owner and _card.

Parameters
_ownerAn owner of the card.
_cardA reference to the card.

◆ ~Entity()

virtual RosettaStone::Entity::~Entity ( )
virtual

Destructor.

◆ Entity() [3/4]

RosettaStone::Entity::Entity ( const Entity ent)

Copy constructor.

◆ Entity() [4/4]

RosettaStone::Entity::Entity ( Entity &&  ent)
noexcept

Move constructor.

Member Function Documentation

◆ Destroy()

virtual void RosettaStone::Entity::Destroy ( )
virtual

◆ GetFromCard()

static Entity* RosettaStone::Entity::GetFromCard ( Player player,
Card &&  card 
)
static

Creates entity from the card.

Parameters
playerA player to get the card.
cardA card to draw.
Returns
A pointer to entity that is allocated dynamically.

◆ GetGameTag()

int RosettaStone::Entity::GetGameTag ( GameTag  tag) const

Returns the value of game tag.

Parameters
tagThe game tag of card.
Returns
The value of game tag.

◆ GetOwner()

Player& RosettaStone::Entity::GetOwner ( ) const

Returns the owner of character.

Returns
The owner of character.

◆ operator=() [1/2]

Entity& RosettaStone::Entity::operator= ( const Entity ent)

Copy assignment operator.

◆ operator=() [2/2]

Entity& RosettaStone::Entity::operator= ( Entity &&  ent)
noexcept

Move assignment operator.

◆ SetGameTag()

virtual void RosettaStone::Entity::SetGameTag ( GameTag  tag,
int  value 
)
virtual

Sets game tag to the card.

Parameters
tagThe game tag to indicate ability or condition.
valueThe value to set for game tag.

◆ SetOwner()

void RosettaStone::Entity::SetOwner ( Player owner)

Sets the owner of character.

Parameters
ownerThe owner of character.

Member Data Documentation

◆ card

Card RosettaStone::Entity::card

◆ id

std::size_t RosettaStone::Entity::id = 0

◆ isDestroyed

bool RosettaStone::Entity::isDestroyed = false

◆ m_gameTags

std::map<GameTag, int> RosettaStone::Entity::m_gameTags
protected

◆ m_owner

Player* RosettaStone::Entity::m_owner = nullptr
protected

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