RosettaStone::Generic Namespace Reference
Functions | |
void | Attack (Player &player, Character *source, Character *target) |
void | ChoiceMulligan (Player &player, const std::vector< std::size_t > &choices) |
void | CreateChoice (Player &player, ChoiceType type, ChoiceAction action, const std::vector< std::size_t > &choices) |
Entity * | Draw (Player &player, std::optional< Entity > cardToDraw=std::nullopt) |
Entity * | DrawCard (Player &player, Card &&card) |
void | AddCardToHand (Player &player, Entity *entity) |
void | RemoveCardFromHand (Player &player, Entity *entity) |
void | ChangeManaCrystal (Player &player, int amount, bool fill) |
void | PlayCard (Player &player, Entity *source, Character *target=nullptr, int fieldPos=-1) |
void | PlayMinion (Player &player, Minion *minion, Character *target=nullptr, int fieldPos=-1) |
void | PlaySpell (Player &player, Spell *spell, Character *target=nullptr) |
void | PlayWeapon (Player &player, Weapon *weapon, Character *target=nullptr) |
bool | IsValidTarget (Entity *source, Entity *target) |
Function Documentation
◆ AddCardToHand()
Adds card to hand.
- Parameters
-
player The player to add card to hand. entity A card to add.
◆ Attack()
Source character attacks target character.
- Parameters
-
player An owner of source character. source A pointer to source character. target A pointer to target character.
◆ ChangeManaCrystal()
Changes mana crystal of the player.
- Parameters
-
player The player to change mana crystal. amount A value indicating how much to change mana crystal. fill true if mana crystal is filled, and false otherwise.
◆ ChoiceMulligan()
void RosettaStone::Generic::ChoiceMulligan | ( | Player & | player, |
const std::vector< std::size_t > & | choices | ||
) |
Choices cards in mulligan state.
- Parameters
-
player The player to create a choice cards. choices A container of card to choose.
◆ CreateChoice()
void RosettaStone::Generic::CreateChoice | ( | Player & | player, |
ChoiceType | type, | ||
ChoiceAction | action, | ||
const std::vector< std::size_t > & | choices | ||
) |
Creates a choice for player.
- Parameters
-
player The player to create a choice. type A choice type. action A choice action. choices A container of card to choose.
◆ Draw()
Entity* RosettaStone::Generic::Draw | ( | Player & | player, |
std::optional< Entity > | cardToDraw = std::nullopt |
||
) |
Draws a card in the deck.
- Parameters
-
player The player to add card to the hand. cardToDraw A card to draw in the deck.
- Returns
- A dynamic allocated entity object.
◆ DrawCard()
Draws a specific card to the hand.
- Parameters
-
player The player to add card to the hand. card A card to draw to the hand.
- Returns
- A dynamic allocated entity object.
◆ IsValidTarget()
◆ PlayCard()
void RosettaStone::Generic::PlayCard | ( | Player & | player, |
Entity * | source, | ||
Character * | target = nullptr , |
||
int | fieldPos = -1 |
||
) |
Plays a card from player's hand.
- Parameters
-
player The player to play card. source A pointer to source entity to play card. target A target of the character to receive power. fieldPos A value indicating where to place card.
◆ PlayMinion()
void RosettaStone::Generic::PlayMinion | ( | Player & | player, |
Minion * | minion, | ||
Character * | target = nullptr , |
||
int | fieldPos = -1 |
||
) |
Plays a minion card from player's hand.
- Parameters
-
player The player to play minion card. minion A pointer to minion card to play. target A target of the character to receive power. fieldPos A value indicating where to place card.
◆ PlaySpell()
void RosettaStone::Generic::PlaySpell | ( | Player & | player, |
Spell * | spell, | ||
Character * | target = nullptr |
||
) |
Plays a spell card from player's hand.
- Parameters
-
player The player to play spell card. spell A pointer to spell card to play. target A target of the character to receive power.
◆ PlayWeapon()
void RosettaStone::Generic::PlayWeapon | ( | Player & | player, |
Weapon * | weapon, | ||
Character * | target = nullptr |
||
) |
Plays a weapon card from player's hand.
- Parameters
-
player The player to play weapon card. weapon A pointer to weapon card to play. target A target of the character to receive power.