Abstract entity structure that stores card data. More...
#include <Rosetta/Models/Entity.hpp>
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... | |
| Entity & | operator= (const Entity &ent) |
| Copy assignment operator. More... | |
| Entity & | operator= (Entity &&ent) noexcept |
| Move assignment operator. More... | |
| Player & | GetOwner () 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 Entity * | GetFromCard (Player &player, Card &&card) |
Public Attributes | |
| Card | card |
| std::size_t | id = 0 |
| bool | isDestroyed = false |
Protected Attributes | |
| Player * | m_owner = nullptr |
| std::map< GameTag, int > | m_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]
|
default |
Default constructor.
◆ Entity() [2/4]
Constructs entity with given _owner and _card.
- Parameters
-
_owner An owner of the card. _card A reference to the card.
◆ ~Entity()
|
virtual |
Destructor.
◆ Entity() [3/4]
| RosettaStone::Entity::Entity | ( | const Entity & | ent | ) |
Copy constructor.
◆ Entity() [4/4]
|
noexcept |
Move constructor.
Member Function Documentation
◆ Destroy()
|
virtual |
Destroys character.
Reimplemented in RosettaStone::Character, RosettaStone::Hero, RosettaStone::Weapon, RosettaStone::HeroPower, RosettaStone::Minion, and RosettaStone::Spell.
◆ GetFromCard()
Creates entity from the card.
- Parameters
-
player A player to get the card. card A 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
-
tag The 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]
◆ operator=() [2/2]
◆ SetGameTag()
|
virtual |
Sets game tag to the card.
- Parameters
-
tag The game tag to indicate ability or condition. value The value to set for game tag.
◆ SetOwner()
| void RosettaStone::Entity::SetOwner | ( | Player & | owner | ) |
Sets the owner of character.
- Parameters
-
owner The 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
|
protected |
◆ m_owner
|
protected |
The documentation for this class was generated from the following file:
- Rosetta/Models/Entity.hpp
1.8.14