ScenarioMoveStatesWrapper.hpp
1 #pragma once
2 #include <Scenario/Commands/Interval/SetMaxDuration.hpp>
3 #include <Scenario/Commands/Interval/SetMinDuration.hpp>
4 #include <Scenario/Commands/Scenario/Displacement/MoveEventMeta.hpp>
5 #include <Scenario/Commands/Scenario/Displacement/MoveInterval.hpp>
6 #include <Scenario/Palette/Tools/States/MoveAndMergeState.hpp>
7 #include <Scenario/Palette/Tools/States/MoveIntervalState.hpp>
8 #include <Scenario/Palette/Tools/States/MoveStates.hpp>
9 #include <Scenario/Palette/Transitions/EventTransitions.hpp>
10 #include <Scenario/Palette/Transitions/IntervalTransitions.hpp>
11 #include <Scenario/Palette/Transitions/StateTransitions.hpp>
12 #include <Scenario/Palette/Transitions/TimeSyncTransitions.hpp>
13 
14 #include <score/statemachine/StateMachineTools.hpp>
15 namespace Scenario
16 {
18 {
19 public:
20  template <typename Scenario_T, typename ToolPalette_T>
21  static auto make(const ToolPalette_T& palette, QState* waitState, QState& parent)
22  {
25  auto moveInterval = new MoveIntervalState<ToolPalette_T>{
26  palette, palette.model(), palette.context().context.commandStack,
27  palette.context().context.objectLocker, &parent};
28 
29  score::make_transition<ClickOnInterval_Transition<Scenario_T>>(
30  waitState, moveInterval, *moveInterval);
31  moveInterval->addTransition(moveInterval, finishedState(), waitState);
32  return moveInterval;
33  }
34 };
35 
37 {
38 public:
39  template <typename Scenario_T, typename ToolPalette_T>
40  static auto make(const ToolPalette_T& palette, QState* waitState, QState& parent)
41  {
42  auto moveBrace = new MoveIntervalBraceState<
43  Scenario::Command::SetMinDuration, Scenario_T, ToolPalette_T>{
44  palette, palette.model(), palette.context().context.commandStack,
45  palette.context().context.objectLocker, &parent};
46  score::make_transition<ClickOnLeftBrace_Transition<Scenario_T>>(
47  waitState, moveBrace, *moveBrace);
48  moveBrace->addTransition(moveBrace, finishedState(), waitState);
49  return moveBrace;
50  }
51 };
52 
54 {
55 public:
56  template <typename Scenario_T, typename ToolPalette_T>
57  static auto make(const ToolPalette_T& palette, QState* waitState, QState& parent)
58  {
59  auto moveBrace = new MoveIntervalBraceState<
60  Scenario::Command::SetMaxDuration, Scenario_T, ToolPalette_T>{
61  palette, palette.model(), palette.context().context.commandStack,
62  palette.context().context.objectLocker, &parent};
63  score::make_transition<ClickOnRightBrace_Transition<Scenario_T>>(
64  waitState, moveBrace, *moveBrace);
65  moveBrace->addTransition(moveBrace, finishedState(), waitState);
66  return moveBrace;
67  }
68 };
69 
71 {
72 public:
73  template <typename Scenario_T, typename ToolPalette_T>
74  static auto make(const ToolPalette_T& palette, QState* waitState, QState& parent)
75  {
77  auto moveEvent = new MoveEventState<
78  Scenario::Command::MoveEventMeta, Scenario_T, ToolPalette_T>{
79  palette, palette.model(), palette.context().context.commandStack,
80  palette.context().context.objectLocker, &parent};
81 
82  score::make_transition<ClickOnState_Transition<Scenario_T>>(
83  waitState, moveEvent, *moveEvent);
84 
85  score::make_transition<ClickOnEvent_Transition<Scenario_T>>(
86  waitState, moveEvent, *moveEvent);
87  moveEvent->addTransition(moveEvent, finishedState(), waitState);
88 
89  return moveEvent;
90  }
91 };
92 
94 {
95 public:
96  template <typename Scenario_T, typename ToolPalette_T>
97  static auto make(const ToolPalette_T& palette, QState* waitState, QState& parent)
98  {
100  auto moveTimeSync = new MoveTimeSyncState<
101  Scenario::Command::MoveEventMeta, Scenario_T, ToolPalette_T>{
102  palette, palette.model(), palette.context().context.commandStack,
103  palette.context().context.objectLocker, &parent};
104 
105  score::make_transition<ClickOnTimeSync_Transition<Scenario_T>>(
106  waitState, moveTimeSync, *moveTimeSync);
107 
108  moveTimeSync->addTransition(moveTimeSync, finishedState(), waitState);
109 
110  return moveTimeSync;
111  }
112 };
113 
115 {
116 public:
117  template <typename Scenario_T, typename ToolPalette_T>
118  static auto make(const ToolPalette_T& palette, QState* waitState, QState& parent)
119  {
121  auto moveEvent = new MoveEventState<
122  Scenario::Command::MoveTopEventMeta, Scenario_T, ToolPalette_T>{
123  palette, palette.model(), palette.context().context.commandStack,
124  palette.context().context.objectLocker, &parent};
125 
126  score::make_transition<ClickOnState_Transition<Scenario_T>>(
127  waitState, moveEvent, *moveEvent);
128 
129  score::make_transition<ClickOnEvent_Transition<Scenario_T>>(
130  waitState, moveEvent, *moveEvent);
131  moveEvent->addTransition(moveEvent, finishedState(), waitState);
132 
133  return moveEvent;
134  }
135 };
136 
138 {
139 public:
140  template <typename Scenario_T, typename ToolPalette_T>
141  static auto make(const ToolPalette_T& palette, QState* waitState, QState& parent)
142  {
144  auto moveTimeSync = new MoveTimeSyncState<
145  Scenario::Command::MoveTopEventMeta, Scenario_T, ToolPalette_T>{
146  palette, palette.model(), palette.context().context.commandStack,
147  palette.context().context.objectLocker, &parent};
148 
149  score::make_transition<ClickOnTimeSync_Transition<Scenario_T>>(
150  waitState, moveTimeSync, *moveTimeSync);
151  moveTimeSync->addTransition(moveTimeSync, finishedState(), waitState);
152 
153  return moveTimeSync;
154  }
155 };
156 }
Definition: MoveEventMeta.hpp:24
Definition: MoveEventMeta.hpp:69
The SetMaxDuration class.
Definition: SetMaxDuration.hpp:24
The SetMinDuration class.
Definition: SetMinDuration.hpp:24
Definition: ScenarioMoveStatesWrapper.hpp:71
static auto make(const ToolPalette_T &palette, QState *waitState, QState &parent)
Definition: ScenarioMoveStatesWrapper.hpp:74
Definition: ScenarioMoveStatesWrapper.hpp:115
static auto make(const ToolPalette_T &palette, QState *waitState, QState &parent)
Definition: ScenarioMoveStatesWrapper.hpp:118
Definition: MoveAndMergeState.hpp:95
Definition: MoveStates.hpp:35
Definition: ScenarioMoveStatesWrapper.hpp:18
static auto make(const ToolPalette_T &palette, QState *waitState, QState &parent)
Definition: ScenarioMoveStatesWrapper.hpp:21
Definition: MoveIntervalState.hpp:33
Definition: ScenarioMoveStatesWrapper.hpp:37
Definition: ScenarioMoveStatesWrapper.hpp:54
Definition: ScenarioMoveStatesWrapper.hpp:94
static auto make(const ToolPalette_T &palette, QState *waitState, QState &parent)
Definition: ScenarioMoveStatesWrapper.hpp:97
Definition: ScenarioMoveStatesWrapper.hpp:138
static auto make(const ToolPalette_T &palette, QState *waitState, QState &parent)
Definition: ScenarioMoveStatesWrapper.hpp:141
Definition: MoveStates.hpp:116
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14