Emergency 20 Dokumentation  4.2.0
TutorialStep.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
15 
16 
17 //[-------------------------------------------------------]
18 //[ Forward declarations ]
19 //[-------------------------------------------------------]
20 namespace em5
21 {
22  class Tutorial;
23  class Objective;
24 }
25 namespace qsf
26 {
27  class Time;
28  class CameraComponent;
29  class CameraControlComponent;
30  class Entity;
31 }
32 
33 
34 //[-------------------------------------------------------]
35 //[ Namespace ]
36 //[-------------------------------------------------------]
37 namespace em5
38 {
39 
40 
41  //[-------------------------------------------------------]
42  //[ Classes ]
43  //[-------------------------------------------------------]
49  {
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
60  explicit TutorialStep(Tutorial& tutorial);
61 
66  virtual ~TutorialStep();
67 
72  virtual void startup();
73 
84  virtual bool update(const qsf::Time& timePassed) = 0;
85 
90  virtual void shutdown();
91 
92  virtual const std::string getLayerId() const;
93  virtual const std::string getEraseLayerId() const;
94 
95  virtual const qsf::Entity* getFocusEntity();
96 
97 
98  //[-------------------------------------------------------]
99  //[ Protected methods ]
100  //[-------------------------------------------------------]
101  protected:
102  inline Tutorial& getTutorial();
103 
104  qsf::Entity* acquireTaggedEntity(const std::string& tag);
107 
108  void clearObjectives();
109  void changeEventName(const std::string& eventName);
110  Objective& createObjective(uint32 objectiveId, const std::string& objectiveText);
111  void markObjectiveAsAccomplished(const uint32 objectiveId);
112 
113  bool hasSupervisorEnded(const qsf::Time& timePassed);
115  bool hasWaitTimeEnded(qsf::Time& remainingWaitTime, const qsf::Time& timePassed);
116  bool hasPauseBetweenSubStepsEnded(const qsf::Time& timePassed) const;
117 
118  void showTextWindow(bool show) const;
119  void clearTextWindow() const;
120  void showObjectiveWindow(bool show) const;
121 
123  void flyToCamera(const qsf::Entity& targetCameraEntity, float maximumSpeed = 200.0f);
124  void flyToEntity(const qsf::Entity& targetEntity, bool jumpDirectly = false);
125  void startFollowEntity(const qsf::Entity& targetEntity, float distance = 25.0f);
126  void stopFollowEntity();
127 
128  bool isEntitySelected(uint64 entityId);
129 
130  void clearSelection();
131 
132  void showUserInterface(bool show) const;
133 
134  void showSupervisorMessage(const std::string& textId);
135 
136  void showOrderAreaMarker(qsf::Entity* orderAreaEntity, bool show);
137 
138  void makeEntitySelectable(qsf::Entity& entity, bool selectable);
139 
140  void setupUnitAfterSpawn(qsf::Entity& unitVehicle);
141 
142 
143  //[-------------------------------------------------------]
144  //[ Protected data ]
145  //[-------------------------------------------------------]
146  protected:
149 
150 
151  //[-------------------------------------------------------]
152  //[ Private methods ]
153  //[-------------------------------------------------------]
154  private:
155  void onPreCommandCheckForCancel(const qsf::MessageParameters& parameters);
156 
157 
158  //[-------------------------------------------------------]
159  //[ Private data ]
160  //[-------------------------------------------------------]
161  private:
162  Tutorial& mTutorial;
163  qsf::MessageProxy mCancelCommandMessageProxy;
164 
165 
166  };
167 
168 
169 //[-------------------------------------------------------]
170 //[ Namespace ]
171 //[-------------------------------------------------------]
172 } // em5
173 
174 
175 //[-------------------------------------------------------]
176 //[ Implementation ]
177 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
void showSupervisorMessage(const std::string &textId)
qsf::CameraComponent * getCameraComponent() const
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
void flyToCamera(const qsf::Entity &targetCameraEntity, float maximumSpeed=200.0f)
void showOrderAreaMarker(qsf::Entity *orderAreaEntity, bool show)
unsigned int uint32
Definition: PlatformTypes.h:181
bool hasWaitTimeEnded(qsf::Time &remainingWaitTime, const qsf::Time &timePassed)
virtual ~TutorialStep()
Destructor.
void setupUnitAfterSpawn(qsf::Entity &unitVehicle)
Objective & createObjective(uint32 objectiveId, const std::string &objectiveText)
Camera component class.
Definition: CameraComponent.h:50
qsf::Entity * acquireTaggedEntity(const std::string &tag)
void showTextWindow(bool show) const
EMERGENCY 5 tutorial step base class.
Definition: TutorialStep.h:48
Message listener proxy class.
Definition: MessageProxy.h:47
uint64_t uint64
Definition: PlatformTypes.h:184
qsf::Entity * mOnlyCommandTargetAllowed
Definition: TutorialStep.h:148
TutorialStep(Tutorial &tutorial)
Default constructor.
virtual void shutdown()
Shutdown call for the tutorial step.
virtual const std::string getEraseLayerId() const
bool isEntitySelected(uint64 entityId)
EMERGENCY 5 objective class.
Definition: Objective.h:51
Definition: PickupPersonByParamedicAction.h:21
void markObjectiveAsAccomplished(const uint32 objectiveId)
void cancelSupervisorMessage()
void changeEventName(const std::string &eventName)
bool hasSupervisorEnded(const qsf::Time &timePassed)
void startFollowEntity(const qsf::Entity &targetEntity, float distance=25.0f)
Tutorial & getTutorial()
Definition: TutorialStep-inl.h:14
void flyToEntity(const qsf::Entity &targetEntity, bool jumpDirectly=false)
bool hasPauseBetweenSubStepsEnded(const qsf::Time &timePassed) const
qsf::CameraControlComponent * getCameraControlComponent() const
virtual bool update(const qsf::Time &timePassed)=0
Updates the tutorial step.
virtual const std::string getLayerId() const
virtual const qsf::Entity * getFocusEntity()
bool hasCameraStoppedAutomaticMovement()
void showUserInterface(bool show) const
virtual void startup()
Startup call for the tutorial step.
uint64 mOnlyCommandAllowed
Definition: TutorialStep.h:147
EMERGENCY 5 tutorial event.
Definition: Tutorial.h:55
void showObjectiveWindow(bool show) const
Camera control component class.
Definition: CameraControlComponent.h:40
void makeEntitySelectable(qsf::Entity &entity, bool selectable)
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32
void clearTextWindow() const