Emergency 20 Dokumentation  4.2.0
TutorialStepStation2.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 //[-------------------------------------------------------]
14 
15 #include <qsf/job/JobProxy.h>
17 #include <qsf/math/Transform.h>
19 
20 
21 //[-------------------------------------------------------]
22 //[ Namespace ]
23 //[-------------------------------------------------------]
24 namespace em5
25 {
26 
27 
28  //[-------------------------------------------------------]
29  //[ Classes ]
30  //[-------------------------------------------------------]
37  {
38 
39 
40  //[-------------------------------------------------------]
41  //[ Public methods ]
42  //[-------------------------------------------------------]
43  public:
48  TutorialStepStation2(Tutorial& tutorial);
49 
54  virtual ~TutorialStepStation2();
55 
56 
57  //[-------------------------------------------------------]
58  //[ Public virtual em5::TutorialStep methods ]
59  //[-------------------------------------------------------]
60  public:
61  virtual void startup() override;
62  virtual bool update(const qsf::Time& timePassed) override;
63  virtual void shutdown() override;
64  virtual const std::string getLayerId() const override;
65  virtual const std::string getEraseLayerId() const override;
66 
67 
68  //[-------------------------------------------------------]
69  //[ Private definitions ]
70  //[-------------------------------------------------------]
71  private:
72  enum class STATE
73  {
74  STARTUP,
76  WAIT_SOME_TIME_FOR_STARTING_FIRST_SUPERVISOR_MESSAGE, // State to wait ~2 seconds before showing first supervisor message in this station
137  END,
138  };
139 
140 
141  //[-------------------------------------------------------]
142  //[ Private methods ]
143  //[-------------------------------------------------------]
144  private:
145  void onMinimapClicked(const qsf::MessageParameters& parameters);
146  void onSelectionChangedForObjective10a(const qsf::MessageParameters& parameters);
147  void onCheckInRwTargetCommandSend(const qsf::MessageParameters& parameters);
148  void onLetPersonExitRwVehicle(const qsf::MessageParameters& parameters);
149  void onFirefighterSelectedCheck(const qsf::MessageParameters& parameters);
150  void onGetRescuecutterCommandExecuted(const qsf::MessageParameters& parameters);
151  void onCutRoadvehicleCommandExecuted(const qsf::MessageParameters& parameters);
152  void onPersonRescuredFromVehicle(const qsf::MessageParameters& parameters);
153  void onNefGetsSpawned(const qsf::MessageParameters& parameters);
154  void onLetPersonExitNefVehicle(const qsf::MessageParameters& parameters);
155  void onTreatPersonCommandExecuted(const qsf::MessageParameters& parameters);
156  void onPersonIsTransportable(const qsf::MessageParameters& parameters);
157  void onRtwGetsSpawned(const qsf::MessageParameters& parameters);
158  void onLetPersonExitRtwVehicle(const qsf::MessageParameters& parameters);
159  void onPersonGetsPickedUp(const qsf::MessageParameters& parameters);
160  void onAsfGetsSpawned(const qsf::MessageParameters& parameters);
161  void onCarGetsPickedUp(const qsf::MessageParameters& parameters);
162  void onCarGotPickedUp(const qsf::MessageParameters& parameters);
163  void onEnterVehicleCommandExecuted(const qsf::MessageParameters& parameters);
164  void onReturnToBaseCommandExecuted(const qsf::MessageParameters& parameters);
165 
166  void gatherAllEventEntities();
167 
168  bool hasAllFirefightersEnteredTheVehicle(bool pushEnterWhenActionEmpty = false);
169  bool hasDoctorEnteredTheVehicle();
170 
171  void setEventNameForObjectiv8a();
172  void ShowTutorialObjective8a();
173  void ShowTutorialObjectives9();
174  void ShowTutorialObjectives10();
175  void ShowTutorialObjectives11();
176  void ShowTutorialObjectives12();
177  void ShowTutorialObjectives13();
178  void ShowTutorialObjectives14();
179  void ShowTutorialObjectives15();
180  void ShowTutorialObjectives16();
181  void ShowTutorialObjectives17();
182  void ShowTutorialObjectives18();
183 
184  void setupChecksForObjectives10();
185  void setupChecksForObjectives11();
186  void setupChecksForObjectives12();
187 
188  void showRwTargetEntityOnMapAndOnMinimap(bool show);
189  void showNefTargetEntityOnMapAndOnMinimap(bool show);
190  void showRtwTargetEntityOnMapAndOnMinimap(bool show);
191  void showAsfTargetEntityOnMapAndOnMinimap(bool show);
192 
193  void setupMinimapClickRestriction();
194  void showHighlightAreaOnMinimap(bool show);
195  void activateEntity(qsf::Entity* entity, bool active);
196 
197  void enableCameraScrolling(bool enable);
198  // We only need xz position the hight doesn't matter
199  const glm::vec2 getCameraPosition();
200 
201  bool hasPlayerScrolled(const qsf::Time& timePassed);
202 
203  void flyCameraToOrderedRwEntity();
204 
205  bool isAmbulanceVehicleListHudWindowOpen(const qsf::Time& timePassed);
206  bool isNefVehicleOrderHudWindowOpen(const qsf::Time& timePassed);
207  bool isRtwVehicleOrderHudWindowOpen(const qsf::Time& timePassed);
208  bool isTecVehicleListHudWindowOpen(const qsf::Time& timePassed);
209  bool isAsfVehicleOrderHudWindowOpen(const qsf::Time& timePassed);
210 
211  void onWaitForObjectives18Completed(const qsf::Time& timePassed);
212 
213  void checkForHint16(const qsf::Time& timePassed);
214  void checkForHint17(const qsf::Time& timePassed);
215  void checkForHint18(const qsf::Time& timePassed);
216 
217  void setupCameraToShowAccident();
218  void letUnitMoveToTargetPosition(qsf::Entity& unitEntity, const glm::vec3& targetPosition);
219 
220 
221  //[-------------------------------------------------------]
222  //[ Private data ]
223  //[-------------------------------------------------------]
224  private:
225  STATE mCurrentState;
226  qsf::Entity* mMinimapClickRestrictionEntity;
227  qsf::Entity* mCrashedCarEntity;
228  qsf::Entity* mInjuredDriverEntity;
229  qsf::Entity* mRwOrderTargetEntity;
230  qsf::Entity* mNefOrderTargetEntity;
231  qsf::Entity* mRtwOrderTargetEntity;
232  qsf::Entity* mAsfOrderTargetEntity;
233  bool mHint11Triggered;
234  glm::vec2 mScrollStartPosition;
235  qsf::Time mRemainingTimeScrolledSlow;
236  qsf::Time mRemainingTimeScrolledFast;
237  bool mCheckForHint12;
238  qsf::Time mRemainingWaitTimeForHint12;
239  qsf::Time mRemainingWaitTimeForHint14Check;
240  qsf::Entity* mUnitEntity;
241  qsf::Time mRemainingWaitTimeForHint15;
242  bool mHint15Triggered;
243  qsf::Entity* mRtwUnitEntity;
244  qsf::Entity* mRwUnitEntity;
245  qsf::Entity* mNefUnitEntity;
246  uint64 mAsfUnitEntityId;
247  qsf::Time mRemainingWaitTimeForSupervisor31Start;
248  bool mCheckForHint16;
249  qsf::Time mRemainingWaitTimeForHint16;
250  bool mCheckForHint17;
251  qsf::Time mRemainingWaitTimeForHint17;
252  bool mCheckForHint18;
253  qsf::Time mRemainingWaitTimeForHint18;
254  bool mCheckForHint20;
255  qsf::Time mRemainingWaitTimeForHint20;
256  bool mCheckForHint21;
257  qsf::Time mRemainingWaitTimeForHint21;
258  bool mReturnToBaseForNefInitiated;
259  bool mReturnToBaseForRwInitiated;
260  qsf::Transform mCameraTransformOnMinimapClick;
261  bool mLetMinimapMarkerBlink;
262  bool mBlinkState;
263  glm::vec3 mFirefighterTargetAfterCutout;
264  qsf::Entity* mFirefigherWithRescueCutter;
265  qsf::Entity* mDoctor;
266 
267  qsf::MessageProxy mMessageProxy;
268  qsf::MessageProxy mMessageProxyForHint21;
269 
270  bool mSkippedOneFrame; // Dummy variable to indicate if the have skipped one frame
271 
272 
273  };
274 
275 
276 //[-------------------------------------------------------]
277 //[ Namespace ]
278 //[-------------------------------------------------------]
279 } // em5
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
virtual void shutdown() override
Shutdown call for the tutorial step.
virtual bool update(const qsf::Time &timePassed) override
Updates the tutorial step.
EMERGENCY 5 tutorial step base class.
Definition: TutorialStep.h:48
Message listener proxy class.
Definition: MessageProxy.h:47
virtual const std::string getEraseLayerId() const override
uint64_t uint64
Definition: PlatformTypes.h:184
3D transform class
Definition: Transform.h:45
virtual void startup() override
Startup call for the tutorial step.
TutorialStepStation2(Tutorial &tutorial)
Default constructor.
virtual ~TutorialStepStation2()
Destructor.
EMERGENCY 5 tutorial event.
Definition: Tutorial.h:55
virtual const std::string getLayerId() const override
EMERGENCY 5 tutorial step station 2.
Definition: TutorialStepStation2.h:36
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32