#include <Rosetta/Tasks/Tasks.hpp>
Public Member Functions | |
| 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... | |
| ITask & | operator= (const ITask &task)=default |
| Default copy assignment operator. More... | |
| ITask & | operator= (ITask &&task)=default |
| Default move assignment operator. More... | |
| EntityType | GetEntityType () const |
| void | SetSource (Entity *source) |
| void | SetTarget (Entity *target) |
| TaskStatus | Run (Player &player) |
| virtual TaskID | GetTaskID () const =0 |
Static Public Attributes | |
| template<typename T > | |
| static constexpr bool | isTask |
Protected Attributes | |
| EntityType | m_entityType = EntityType::EMPTY |
| Entity * | m_source = nullptr |
| Entity * | m_target = nullptr |
Detailed Description
ITask class.
This class is interface of various task classes. All classes that inherit from it must implement GetTaskID and Impl methods.
Constructor & Destructor Documentation
◆ ITask() [1/6]
|
default |
Default constructor.
◆ ITask() [2/6]
| RosettaStone::ITask::ITask | ( | EntityType | entityType | ) |
Constructs task with given entityType.
- Parameters
-
entityType The entity type of target.
◆ ITask() [3/6]
Constructs task with given source and target.
- Parameters
-
source A source entity to apply task. target A target entity to apply task.
◆ ITask() [4/6]
Constructs task with given entityType, source and target.
- Parameters
-
entityType The entity type of target. source A source entity to apply task. target A target entity to apply task.
◆ ~ITask()
|
virtualdefault |
Default destructor.
◆ ITask() [5/6]
|
default |
Default copy constructor.
◆ ITask() [6/6]
|
default |
Default move constructor.
Member Function Documentation
◆ GetEntityType()
| EntityType RosettaStone::ITask::GetEntityType | ( | ) | const |
Returns entity type.
- Returns
- Entity type.
◆ GetTaskID()
|
pure virtual |
Returns task ID (pure virtual).
- Returns
- Task ID.
Implemented in RosettaStone::DoUntil, RosettaStone::PlayerTasks::PlayCardTask, RosettaStone::SimpleTasks::ModifyManaTask, RosettaStone::PlayerTasks::ChooseTask, RosettaStone::DoBothPlayer, RosettaStone::PlayerTasks::AttackTask, RosettaStone::SimpleTasks::AddEnchantmentTask, RosettaStone::SimpleTasks::ControlTask, RosettaStone::SimpleTasks::DamageTask, RosettaStone::SimpleTasks::HealTask, RosettaStone::SimpleTasks::IncludeTask, RosettaStone::SimpleTasks::DestroyTask, RosettaStone::SimpleTasks::DiscardTask, RosettaStone::SimpleTasks::DrawTask, RosettaStone::SimpleTasks::HealFullTask, and RosettaStone::PlayerTasks::EndTurnTask.
◆ operator=() [1/2]
Default copy assignment operator.
◆ operator=() [2/2]
◆ Run()
| TaskStatus RosettaStone::ITask::Run | ( | Player & | player | ) |
Calls Impl method and returns meta data.
- Parameters
-
player The player to run task.
- Returns
- The result of task processing.
◆ SetSource()
| void RosettaStone::ITask::SetSource | ( | Entity * | source | ) |
Sets the source.
- Parameters
-
source A pointer to the source.
◆ SetTarget()
| void RosettaStone::ITask::SetTarget | ( | Entity * | target | ) |
Sets the target.
- Parameters
-
target A pointer to the target.
Member Data Documentation
◆ isTask
|
inlinestatic |
◆ m_entityType
|
protected |
◆ m_source
|
protected |
◆ m_target
|
protected |
The documentation for this class was generated from the following file:
- Rosetta/Tasks/Tasks.hpp
1.8.14