Emergency 20 Dokumentation  4.2.0
MainEvent308.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 em5
20 {
21  class GangsterME308FactoryBoss;
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  MainEvent308();
65 
70  virtual ~MainEvent308();
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  virtual void onIntroFinished(const qsf::MessageParameters& parameters) override;
118 
119  //[-------------------------------------------------------]
120  //[ Regular update ]
121  //[-------------------------------------------------------]
122  virtual void onUpdateMainEvent(const qsf::Time& timePassed) override;
123 
124  virtual uint32 getEventNumber() override;
125 
126 
127  //[-------------------------------------------------------]
128  //[ Private methods ]
129  //[-------------------------------------------------------]
130  private:
131  void setupScene();
132  void startObjectives();
133 
134  void onCameraFlightStopped(const qsf::MessageParameters& parameters);
135  void onCutsceneEventKill(const qsf::MessageParameters& parameters);
136  void onCutsceneEventErase(const qsf::MessageParameters& parameters);
137  void onCutsceneEnd(const qsf::MessageParameters& parameters);
138 
139  void onPersonSavedPlacedFromDLK(const qsf::MessageParameters& parameters);
140  void onBuriedFound(const qsf::MessageParameters& parameters);
141 
142  void triggerHouseBreakdown();
143 
144 
145  //[-------------------------------------------------------]
146  //[ Private data ]
147  //[-------------------------------------------------------]
148  private:
149  // Connected to CAMP
150  qsf::Time mTimeUntilHouseBreakdown;
151  qsf::Time mGangsterWaitTime;
152  qsf::Time mHint01WaitTime;
153  qsf::Time mHint02WaitTime;
154 
155  // Internal
156  qsf::WeakPtr<qsf::Entity> mCollapsingHouse;
157  qsf::WeakPtr<qsf::Entity> mCollapsingHouseCamera;
158  qsf::WeakPtr<qsf::Entity> mHouseDeathZone;
159  qsf::WeakPtr<qsf::Entity> mGangster;
160  qsf::WeakPtr<qsf::Entity> mGangsterTarget;
162  std::vector<qsf::WeakPtr<qsf::Entity>> mPersonsToFindByDog;
163 
164  qsf::MessageProxy mCameraFlightStoppedMessageProxy;
165  qsf::MessageProxy mCutsceneEventKillMessageProxy;
166  qsf::MessageProxy mCutsceneEventEraseMessageProxy;
167  qsf::MessageProxy mCutsceneEndMessageProxy;
168  qsf::MessageProxy mBalconyPersonSaveProxy;
169  qsf::MessageProxy mBuriedFoundMessageProxy;
170 
171  bool mDeathZoneEvacuated;
172  bool mHouseBreakdownTriggered;
173 
174 
175  //[-------------------------------------------------------]
176  //[ CAMP reflection system ]
177  //[-------------------------------------------------------]
178  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
179 
180 
181  };
182 
183 
184 //[-------------------------------------------------------]
185 //[ Namespace ]
186 //[-------------------------------------------------------]
187 } // em5
188 
189 
190 //[-------------------------------------------------------]
191 //[ CAMP reflection system ]
192 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
virtual bool onStartup() override
React to startup of the freeplay event.
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
virtual void onShutdown() override
React to shutdown of the freeplay event.
virtual void serialize(qsf::BinarySerializer &serializer) override
Serialization using a binary serializer.
unsigned int uint32
Definition: PlatformTypes.h:181
virtual void onTimerTriggered(uint32 timerId) override
Message listener proxy class.
Definition: MessageProxy.h:47
Reason
Definition: EventSpreadReason.h:20
virtual uint32 getEventNumber() override
Gets number of the main event (Is needed for the highscore management)
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 ...
virtual void hintCallback(Observer &hintObserver) override
Handle the activation of a hint observer.
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...
virtual void onRun() override
React to state change from (initial) hidden state to running state.
#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
EMERGENCY 20 years edition mission 08 "Fireworks Factory".
Definition: MainEvent308.h:39
virtual void onIntroFinished(const qsf::MessageParameters &parameters) override
React to the end of the intro; note that the prologue cutscene is played next.
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.
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
MainEvent308()
Default constructor.
static const uint32 FREEPLAY_EVENT_ID
"em5::MainEvent308" unique freeplay event ID
Definition: MainEvent308.h:53
virtual ~MainEvent308()
Destructor.
virtual bool onFailure(EventResult &eventResult) override
React to state change from running state to failed state.
Static CAMP main event plugin metaclass collection class.
Definition: MainEventMetaclasses.h:30
virtual uint32 calculatePointGain(EventResult &eventResult) override
Calculate the point gain for this event.
Binary serializer class.
Definition: BinarySerializer.h:35
virtual bool onSuccess(EventResult &eventResult) override
React to state change from running state to success state.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32