Emergency 20 Dokumentation  4.2.0
TutorialStepStation1.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>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class CameraControlComponent;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Classes ]
36  //[-------------------------------------------------------]
43  {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Public methods ]
48  //[-------------------------------------------------------]
49  public:
54  TutorialStepStation1(Tutorial& tutorial);
55 
60  virtual ~TutorialStepStation1();
61 
62 
63  //[-------------------------------------------------------]
64  //[ Public virtual em5::TutorialStep methods ]
65  //[-------------------------------------------------------]
66  public:
67  virtual void startup() override;
68  virtual bool update(const qsf::Time& timePassed) override;
69  virtual void shutdown() override;
70  virtual const std::string getLayerId() const override;
71  virtual const std::string getEraseLayerId() const override;
72 
73 
74  //[-------------------------------------------------------]
75  //[ Private definitions ]
76  //[-------------------------------------------------------]
77  private:
78  enum class STATE
79  {
80  STARTUP,
140  END,
141  };
142 
143 
144  //[-------------------------------------------------------]
145  //[ Private methods ]
146  //[-------------------------------------------------------]
147  private:
148  void introFinished(const qsf::MessageParameters& parameters);
149  void onRwGetsOrdered(const qsf::MessageParameters& parameters);
150  void onRwGetsSpawned(const qsf::MessageParameters& parameters);
151  void onRwReachesTargetPosition(const qsf::MessageParameters& parameters);
152  void onLetPersonExitRwVehicle(const qsf::MessageParameters& parameters);
153  void onSelectionChangedForSingleSelect(const qsf::MessageParameters& parameters);
154  void onGetHoseCommandExecuted(const qsf::MessageParameters& parameters);
155  void onExtinguishWithHoseCommandExecuted(const qsf::MessageParameters& parameters);
156  void onExtinguishingStarted(const qsf::MessageParameters& parameters);
157  void onGetHoseCommandExecutedForCooling(const qsf::MessageParameters& parameters);
158  void onCoolWithHoseCommandExecuted(const qsf::MessageParameters& parameters);
159  void onCoolingStarted(const qsf::MessageParameters& parameters);
160  void onSelectionChanged(const qsf::MessageParameters& parameters);
161  void onEnterVehicleCommandExecuted(const qsf::MessageParameters& parameters);
162 
163  void waitForHelpVideoEnd(const qsf::JobArguments& jobArguments);
164  void waitForCameraReachesHq(const qsf::JobArguments& jobArguments);
165 
166  void setupSnackBoothPart();
167 
168  qsf::CameraControlComponent* getCameraControlComponent();
169  // The zoom state is the distance to target value
170  int getCameraZoomState();
171  // We need only one value and there only the numbers bfore the period
172  int getCameraRotation();
173 
174  void ShowTutorialObjective1();
175 
176  void ShowTutorialObjective2();
177  void enableInputForObjective2();
178  bool checkPlayerInputForObjective2a();
179  bool checkPlayerInputForObjective2b();
180 
181  void ShowTutorialObjective3a();
182  void ShowTutorialObjective3b();
183  void ShowTutorialObjective3c();
184  void ShowTutorialObjective3d();
185  void ShowTutorialObjective4a();
186  void ShowTutorialObjective4b();
187  void ShowTutorialObjective5a();
188  void ShowTutorialObjective5b();
189  void ShowTutorialObjectives6();
190  void ShowTutorialObjective6c();
191  void ShowTutorialObjective6d();
192  void ShowTutorialObjective6e();
193  void ShowTutorialObjectives7();
194  void ShowTutorialObjective7c();
195 
196  bool isVehicleHelpWindowVisible(const qsf::Time& timePassed) const;
197  bool hasHelpVideoEnded(const qsf::Time& timePassed) const;
198 
199  void setupWaitForRwGetsOrdered();
200 
201  void moveFirefightersToTheirTargetPositions();
202 
203  bool haveAllFireFightersBeDisconnectedFromHydrants();
204 
205 
206  //[-------------------------------------------------------]
207  //[ Private data ]
208  //[-------------------------------------------------------]
209  private:
210  STATE mCurrentState;
211  qsf::Entity* mSnackBoothEntity;
212  qsf::Entity* mSnackBoothCoolingEntity;
213  qsf::Entity* mSnackBoothOrderAreaEntity;
214  qsf::Entity* mHqCameraPositionEntity;
215  qsf::Entity* mFirefighterRwEntity;
216  std::vector<qsf::Entity*> mFirefighterPersonTargetEntities;
217  int mInitialTargetToDistanceValue;
218  bool mPlayerDidZoomIn;
219  bool mPlayerDidZoomOut;
220  int mInitialCameraRotation;
221  bool mPlayerDidRotateLeft;
222  bool mPlayerDidRotateRight;
223  qsf::Time mRemainingWaitTimeForExitVehicleFinished;
224  qsf::Time mRemainingWaitTimeForHint00;
225  bool mHint00Triggered;
226  qsf::Time mRemainingWaitTimeForHint01;
227  bool mHint01Triggered;
228  qsf::Time mRemainingWaitTimeForHint02;
229  bool mHint02Triggered;
230  qsf::Time mRemainingWaitTimeForHint03;
231  bool mHint03Triggered;
232  qsf::Time mRemainingWaitTimeForHint04;
233  qsf::Time mRemainingWaitTimeForHint05;
234  bool mHint05Triggered;
235  qsf::Time mRemainingWaitTimeForHint08;
236  bool mHint08Triggered;
237  qsf::Time mRemainingWaitTimeForPlayingSupervisor15;
238  qsf::MessageProxy mMessageProxy;
239  qsf::JobProxy mRealtimeUpdateJobProxy;
240 
241 
242  };
243 
244 
245 //[-------------------------------------------------------]
246 //[ Namespace ]
247 //[-------------------------------------------------------]
248 } // em5
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
virtual ~TutorialStepStation1()
Destructor.
virtual void startup() override
Startup call for 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 getLayerId() const override
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
TutorialStepStation1(Tutorial &tutorial)
Default constructor.
EMERGENCY 5 tutorial step station 1.
Definition: TutorialStepStation1.h:42
EMERGENCY 5 tutorial event.
Definition: Tutorial.h:55
Camera control component class.
Definition: CameraControlComponent.h:40
virtual void shutdown() override
Shutdown call for the tutorial step.
virtual const std::string getEraseLayerId() const override
virtual bool update(const qsf::Time &timePassed) override
Updates the tutorial step.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32