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()

void RosettaStone::Generic::AddCardToHand ( Player &  player,
Entity *  entity 
)

Adds card to hand.

Parameters
playerThe player to add card to hand.
entityA card to add.

◆ Attack()

void RosettaStone::Generic::Attack ( Player &  player,
Character *  source,
Character *  target 
)

Source character attacks target character.

Parameters
playerAn owner of source character.
sourceA pointer to source character.
targetA pointer to target character.

◆ ChangeManaCrystal()

void RosettaStone::Generic::ChangeManaCrystal ( Player &  player,
int  amount,
bool  fill 
)

Changes mana crystal of the player.

Parameters
playerThe player to change mana crystal.
amountA value indicating how much to change mana crystal.
filltrue 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
playerThe player to create a choice cards.
choicesA 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
playerThe player to create a choice.
typeA choice type.
actionA choice action.
choicesA 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
playerThe player to add card to the hand.
cardToDrawA card to draw in the deck.
Returns
A dynamic allocated entity object.

◆ DrawCard()

Entity* RosettaStone::Generic::DrawCard ( Player &  player,
Card &&  card 
)

Draws a specific card to the hand.

Parameters
playerThe player to add card to the hand.
cardA card to draw to the hand.
Returns
A dynamic allocated entity object.

◆ IsValidTarget()

bool RosettaStone::Generic::IsValidTarget ( Entity *  source,
Entity *  target 
)

◆ PlayCard()

void RosettaStone::Generic::PlayCard ( Player &  player,
Entity *  source,
Character *  target = nullptr,
int  fieldPos = -1 
)

Plays a card from player's hand.

Parameters
playerThe player to play card.
sourceA pointer to source entity to play card.
targetA target of the character to receive power.
fieldPosA 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
playerThe player to play minion card.
minionA pointer to minion card to play.
targetA target of the character to receive power.
fieldPosA 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
playerThe player to play spell card.
spellA pointer to spell card to play.
targetA 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
playerThe player to play weapon card.
weaponA pointer to weapon card to play.
targetA target of the character to receive power.

◆ RemoveCardFromHand()

void RosettaStone::Generic::RemoveCardFromHand ( Player &  player,
Entity *  entity 
)

Removes card from hand.

Parameters
playerThe player to remove card from hand.
entityA card to remove.