Emergency 20 Dokumentation  4.2.0
MainEvent306.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 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace qsf
20 {
21  class AssetProxy;
22 }
23 
24 
25 //[-------------------------------------------------------]
26 //[ Namespace ]
27 //[-------------------------------------------------------]
28 namespace em5
29 {
30 
31 
32  //[-------------------------------------------------------]
33  //[ Classes ]
34  //[-------------------------------------------------------]
40  {
41 
42 
43  //[-------------------------------------------------------]
44  //[ Friends ]
45  //[-------------------------------------------------------]
46  friend class MainEventMetaclasses; // CAMP export of editable values for Game Design
47 
48 
49  //[-------------------------------------------------------]
50  //[ Public definitions ]
51  //[-------------------------------------------------------]
52  public:
53  static const uint32 FREEPLAY_EVENT_ID;
54 
55 
56  //[-------------------------------------------------------]
57  //[ Public methods ]
58  //[-------------------------------------------------------]
59  public:
64  MainEvent306();
65 
70  virtual ~MainEvent306();
71 
72 
73  //[-------------------------------------------------------]
74  //[ Public virtual em5::FreeplayEvent methods ]
75  //[-------------------------------------------------------]
76  public:
77  //[-------------------------------------------------------]
78  //[ Lifecycle ]
79  //[-------------------------------------------------------]
80  virtual bool onStartup() override;
81  virtual void onShutdown() override;
82  virtual void onRun() override;
83  virtual bool onSuccess(EventResult& eventResult) override;
84  virtual bool onFailure(EventResult& eventResult) override;
85 
86  //[-------------------------------------------------------]
87  //[ Points evaluation ]
88  //[-------------------------------------------------------]
89  virtual uint32 calculatePointGain(EventResult& eventResult) override;
90 
91  //[-------------------------------------------------------]
92  //[ Callbacks from observers ]
93  //[-------------------------------------------------------]
94  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
95  virtual void hintCallback(Observer& hintObserver) override;
96 
97  //[-------------------------------------------------------]
98  //[ Timers ]
99  //[-------------------------------------------------------]
100  virtual void onTimerTriggered(uint32 timerId) override;
101 
102  //[-------------------------------------------------------]
103  //[ Miscellaneous ]
104  //[-------------------------------------------------------]
105  virtual const qsf::Entity* getFocusEntity() override;
106 
107  //[-------------------------------------------------------]
108  //[ Serialize ]
109  //[-------------------------------------------------------]
110  virtual void serialize(qsf::BinarySerializer& serializer) override;
111 
112 
113  //[-------------------------------------------------------]
114  //[ Protected virtual em5::MainEvent methods ]
115  //[-------------------------------------------------------]
116  protected:
117  //[-------------------------------------------------------]
118  //[ Regular update ]
119  //[-------------------------------------------------------]
120  virtual void onUpdateMainEvent(const qsf::Time& timePassed) override;
121 
122  virtual uint32 getEventNumber() override;
123 
124 
125  //[-------------------------------------------------------]
126  //[ Private definitions ]
127  //[-------------------------------------------------------]
128  private:
129  enum class CameraFlight
130  {
131  NONE,
132  METEOR_2
133  };
134 
135 
136  //[-------------------------------------------------------]
137  //[ Private methods ]
138  //[-------------------------------------------------------]
139  private:
140  void setupSceneForPart(int part);
141  void startObjectives();
142 
143  void startCameraShakeSequence();
144  void startCameraFlight(CameraFlight cameraFlight);
145  void onCameraFlightStopped(const qsf::MessageParameters& parameters);
146 
147  void setMinimapBackground(const qsf::AssetProxy& minimapTexture);
148 
149 
150  //[-------------------------------------------------------]
151  //[ Private data ]
152  //[-------------------------------------------------------]
153  private:
154  // Connected to CAMP
155  uint32 mFailLimitBurningObjects;
156  uint32 mMaxInjuredForMeteor2;
157  uint32 mMaxFiresForMeteor2;
158  qsf::Time mHint01WaitTime;
159  qsf::Time mHint02WaitTime;
160  qsf::Time mMaximumTimeUntilMeteor2;
161  qsf::Time mDelayForMeteor2CameraFlight;
162  qsf::Time mFirefighterBuildingEvacuateTime;
163  glm::vec3 mPart1MapBoundaryTopLeft;
164  glm::vec3 mPart1MapBoundaryBottomRight;
165 
166  // Internal
167  bool mStartedMeteor2;
168  CameraFlight mActiveCameraFlight;
169 
170  glm::vec3 mOriginalMapBoundaryTopLeft;
171  glm::vec3 mOriginalMapBoundaryBottomRight;
172 
173  qsf::MessageProxy mCameraFlightStoppedMessageProxy;
174 
175 
176  //[-------------------------------------------------------]
177  //[ CAMP reflection system ]
178  //[-------------------------------------------------------]
179  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
180 
181 
182  };
183 
184 
185 //[-------------------------------------------------------]
186 //[ Namespace ]
187 //[-------------------------------------------------------]
188 } // em5
189 
190 
191 //[-------------------------------------------------------]
192 //[ CAMP reflection system ]
193 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
virtual ~MainEvent306()
Destructor.
EMERGENCY 20 years edition mission 06 "Meteor".
Definition: MainEvent306.h:39
unsigned int uint32
Definition: PlatformTypes.h:181
virtual uint32 getEventNumber() override
Gets number of the main event (Is needed for the highscore management)
virtual bool addEntityToEvent(qsf::Entity &targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override
React to adding to an entity to this event, i.e. setting the event ID for the entity.
virtual uint32 calculatePointGain(EventResult &eventResult) override
Calculate the point gain for this event.
Message listener proxy class.
Definition: MessageProxy.h:47
Reason
Definition: EventSpreadReason.h:20
virtual void onRun() override
React to state change from (initial) hidden state to running state.
virtual void serialize(qsf::BinarySerializer &serializer) override
Serialization using a binary serializer.
virtual void onTimerTriggered(uint32 timerId) override
virtual void onUpdateMainEvent(const qsf::Time &timePassed) override
Gets called when the main event gets an update call We use here a separate update method...
Definition: PickupPersonByParamedicAction.h:21
static const uint32 FREEPLAY_EVENT_ID
"em5::MainEvent306" unique freeplay event ID
Definition: MainEvent306.h:53
virtual bool onStartup() override
React to startup of the freeplay event.
Asset proxy class.
Definition: AssetProxy.h:57
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
EMERGENCY 20 years edition mission base class.
Definition: Em20MainEventBase.h:30
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
virtual void onShutdown() override
React to shutdown of the freeplay event.
virtual const qsf::Entity * getFocusEntity() override
Get an event entity that is currently crucial for this event This is the entity which gets the focus ...
MainEvent306()
Default constructor.
virtual bool onSuccess(EventResult &eventResult) override
React to state change from running state to success state.
Static CAMP main event plugin metaclass collection class.
Definition: MainEventMetaclasses.h:30
Binary serializer class.
Definition: BinarySerializer.h:35
virtual void hintCallback(Observer &hintObserver) override
Handle the activation of a hint observer.
virtual bool onFailure(EventResult &eventResult) override
React to state change from running state to failed state.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32