TaskWrapper.hpp
Go to the documentation of this file.
1 // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
2 
3 // We are making my contributions/submissions to this project solely in our
4 // personal capacity and are not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef ROSETTASTONE_TASK_WRAPPER_HPP
8 #define ROSETTASTONE_TASK_WRAPPER_HPP
9 
10 #include <Rosetta/Tasks/Tasks.hpp>
11 
12 #include <functional>
13 
14 namespace RosettaStone
15 {
21 class DoBothPlayer : public ITask
22 {
23  public:
26  DoBothPlayer(ITask&& task);
27 
30  TaskID GetTaskID() const override;
31 
32  private:
36  TaskStatus Impl(Player& player) override;
37 
38  ITask& m_task;
39 };
40 
46 class DoUntil : public ITask
47 {
48  public:
52  DoUntil(ITask&& task, std::function<bool(TaskStatus)>&& condition);
53 
58  DoUntil(ITask&& task, TaskStatus id);
59 
62  TaskID GetTaskID() const override;
63 
64  private:
68  TaskStatus Impl(Player& player) override;
69 
70  ITask& m_task;
71  std::function<bool(TaskStatus)> m_condition;
72 };
73 } // namespace RosettaStone
74 
75 #endif // ROSETTASTONE_TASK_WRAPPER_HPP
TaskStatus
Meta data to represent the result of the task.
Definition: TaskStatus.hpp:15
TaskID GetTaskID() const override
DoUntil(ITask &&task, std::function< bool(TaskStatus)> &&condition)
DoUntil class.
Definition: TaskWrapper.hpp:46
Player class.
Definition: Player.hpp:33
Definition: AccountInfo.hpp:14
DoBothPlayer class.
Definition: TaskWrapper.hpp:21
ITask class.
Definition: Tasks.hpp:22
TaskID GetTaskID() const override