RosettaStone::PlayerTasks::PlayCardTask Class Reference

PlayCardTask class. More...

#include <Rosetta/Tasks/PlayerTasks/PlayCardTask.hpp>

Inheritance diagram for RosettaStone::PlayerTasks::PlayCardTask:
RosettaStone::ITask

Public Member Functions

 PlayCardTask (Entity *source, Entity *target=nullptr, int fieldPos=-1)
 
TaskID GetTaskID () const override
 
- Public Member Functions inherited from RosettaStone::ITask
 ITask ()=default
 Default constructor. More...
 
 ITask (EntityType entityType)
 
 ITask (Entity *source, Entity *target)
 
 ITask (EntityType entityType, Entity *source, Entity *target)
 
virtual ~ITask ()=default
 Default destructor. More...
 
 ITask (const ITask &task)=default
 Default copy constructor. More...
 
 ITask (ITask &&task)=default
 Default move constructor. More...
 
ITaskoperator= (const ITask &task)=default
 Default copy assignment operator. More...
 
ITaskoperator= (ITask &&task)=default
 Default move assignment operator. More...
 
EntityType GetEntityType () const
 
void SetSource (Entity *source)
 
void SetTarget (Entity *target)
 
TaskStatus Run (Player &player)
 

Static Public Member Functions

static PlayCardTask Minion (Player &player, Entity *source)
 
static PlayCardTask Spell (Player &player, Entity *source)
 
static PlayCardTask SpellTarget (Player &player, Entity *source, Entity *target)
 
static PlayCardTask Weapon (Player &player, Entity *source)
 

Additional Inherited Members

- Static Public Attributes inherited from RosettaStone::ITask
template<typename T >
static constexpr bool isTask
 
- Protected Attributes inherited from RosettaStone::ITask
EntityType m_entityType = EntityType::EMPTY
 
Entitym_source = nullptr
 
Entitym_target = nullptr
 

Detailed Description

PlayCardTask class.

This class represents the task for playing card from hand. Then it runs each task according to the card type.

Constructor & Destructor Documentation

◆ PlayCardTask()

RosettaStone::PlayerTasks::PlayCardTask::PlayCardTask ( Entity source,
Entity target = nullptr,
int  fieldPos = -1 
)

Constructs task with given source, fieldPos and target.

Parameters
sourceA pointer to source entity to play card.
targetA pointer to target entity to receive power.
fieldPosA value indicating where to place card.

Member Function Documentation

◆ GetTaskID()

TaskID RosettaStone::PlayerTasks::PlayCardTask::GetTaskID ( ) const
overridevirtual

Returns task ID.

Returns
Task ID.

Implements RosettaStone::ITask.

◆ Minion()

static PlayCardTask RosettaStone::PlayerTasks::PlayCardTask::Minion ( Player player,
Entity source 
)
static

PlayCardTask wrapper for minion without target and field position.

Parameters
playerThe player to run task.
sourceA pointer to source entity to play card.
Returns
Generated PlayCardTask for intended purpose.

◆ Spell()

static PlayCardTask RosettaStone::PlayerTasks::PlayCardTask::Spell ( Player player,
Entity source 
)
static

PlayCardTask wrapper for spell without target.

Parameters
playerThe player to run task.
sourceA pointer to source entity to play card.
Returns
Generated PlayCardTask for intended purpose.

◆ SpellTarget()

static PlayCardTask RosettaStone::PlayerTasks::PlayCardTask::SpellTarget ( Player player,
Entity source,
Entity target 
)
static

PlayCardTask wrapper for spell.

Parameters
playerThe player to run task.
sourceA pointer to source entity to play card.
targetA pointer to target entity to receive power.
Returns
Generated PlayCardTask for intended purpose.

◆ Weapon()

static PlayCardTask RosettaStone::PlayerTasks::PlayCardTask::Weapon ( Player player,
Entity source 
)
static

PlayCardTask wrapper for weapon without target.

Parameters
playerThe player to run task.
sourceA pointer to source entity to play card.
Returns
Generated PlayCardTask for intended purpose.

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