Emergency 20 Dokumentation  4.2.0
MainEvent102.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 #include <qsf/base/WeakPtr.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
33  class MainEvent102 : public MainEvent
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Friends ]
39  //[-------------------------------------------------------]
40  friend class MainEventMetaclasses; // CAMP export of editable values for Game Design
41 
42 
43  //[-------------------------------------------------------]
44  //[ Private definitions ]
45  //[-------------------------------------------------------]
46  private:
48  typedef std::vector<WeakEntityPtr> WeakPtrEntityList;
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public definitions ]
53  //[-------------------------------------------------------]
54  public:
55  static const uint32 FREEPLAY_EVENT_ID;
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public methods ]
60  //[-------------------------------------------------------]
61  public:
66  MainEvent102();
67 
72  virtual ~MainEvent102();
73 
74 
75  //[-------------------------------------------------------]
76  //[ Public virtual em5::FreeplayEvent methods ]
77  //[-------------------------------------------------------]
78  public:
79  //[-------------------------------------------------------]
80  //[ Life cycle ]
81  //[-------------------------------------------------------]
82  virtual bool onStartup() override;
83  virtual void onShutdown() override;
84  virtual void onRun() override;
85  virtual bool onSuccess(EventResult& eventResult) override;
86  virtual bool onFailure(EventResult& eventResult) override;
87 
88  //[-------------------------------------------------------]
89  //[ Points evaluation ]
90  //[-------------------------------------------------------]
91  virtual uint32 calculatePointGain(EventResult& eventResult) override;
92 
93  //[-------------------------------------------------------]
94  //[ Callbacks from observers ]
95  //[-------------------------------------------------------]
96  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
97  virtual void hintCallback(Observer& hintObserver) override;
98 
99  //[-------------------------------------------------------]
100  //[ Miscellaneous ]
101  //[-------------------------------------------------------]
102  virtual const qsf::Entity* getFocusEntity() override;
103 
104  //[-------------------------------------------------------]
105  //[ Serialize ]
106  //[-------------------------------------------------------]
107  virtual void serialize(qsf::BinarySerializer& serializer) override;
108 
109 
110  //[-------------------------------------------------------]
111  //[ Protected virtual em5::MainEvent methods ]
112  //[-------------------------------------------------------]
113  protected:
114  virtual void onIntroStart(const qsf::MessageParameters& parameters) override;
115  virtual void onIntroFinished(const qsf::MessageParameters& parameters) override;
116  virtual void onUpdateMainEvent(const qsf::Time& timePassed) override;
117 
118  virtual void onPrologueFinished(const qsf::MessageParameters& parameters) override;
119  virtual void onUpdateMusic(const qsf::Time& timePassed) override;
120  virtual uint32 getEventNumber() override;
121  virtual std::string getCamStartEventTag() override;
122 
123 
124  //[-------------------------------------------------------]
125  //[ Private methods ]
126  //[-------------------------------------------------------]
127  private:
128  void gatherEventEntities();
129 
130  void startObjectives();
131  void startHintObservers();
132 
133 
134  //[-------------------------------------------------------]
135  //[ Private data ]
136  //[-------------------------------------------------------]
137  private:
138  int mMaxInfected;
139 
140  WeakPtrEntityList mBrawler;
141  WeakPtrEntityList mGaper;
142  WeakPtrEntityList mInjured;
143  WeakPtrEntityList mPlague;
144 
145  WeakEntityPtr mCamStart;
146 
147  float mBrawlerUnarmedAggroRange;
148  float mBrawlerUnarmedDeAggroRange;
149  qsf::Time mBrawlerUnarmedCheerTime;
150 
151  qsf::Time mME101Hint01WaitTime;
152  qsf::Time mME102Hint01WaitTime;
153  bool mME101Hint01Triggered;
154 
155 
156  //[-------------------------------------------------------]
157  //[ CAMP reflection system ]
158  //[-------------------------------------------------------]
159  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
160 
161 
162  };
163 
164 
165 //[-------------------------------------------------------]
166 //[ Namespace ]
167 //[-------------------------------------------------------]
168 } // em5
169 
170 
171 //[-------------------------------------------------------]
172 //[ CAMP reflection system ]
173 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
virtual void onIntroFinished(const qsf::MessageParameters &parameters) override
React to the end of the intro; note that the prologue cutscene is played next.
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
virtual std::string getCamStartEventTag() override
Return event tag of a start camera for the event; only necessary for main events without prologue cut...
EMERGENCY 5 main event base class.
Definition: MainEvent.h:48
virtual ~MainEvent102()
Destructor.
unsigned int uint32
Definition: PlatformTypes.h:181
static const uint32 FREEPLAY_EVENT_ID
"em5::MainEvent102" unique freeplay event ID
Definition: MainEvent102.h:55
Reason
Definition: EventSpreadReason.h:20
virtual void hintCallback(Observer &hintObserver) override
Handle the activation of a hint observer.
virtual bool onStartup() override
React to startup of the freeplay event.
virtual bool onFailure(EventResult &eventResult) override
React to state change from running state to failed state.
virtual void serialize(qsf::BinarySerializer &serializer) override
Serialization using a binary serializer.
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.
virtual void onIntroStart(const qsf::MessageParameters &parameters) override
React to the activation of the black screen, which is the start of the intro cutscene.
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 bool onSuccess(EventResult &eventResult) override
React to state change from running state to success state.
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
MainEvent102()
Default constructor.
EMERGENCY 5 main event 102.
Definition: MainEvent102.h:33
virtual uint32 calculatePointGain(EventResult &eventResult) override
Calculate the point gain for this event.
virtual void onPrologueFinished(const qsf::MessageParameters &parameters) override
React to the end of the prologue.
virtual void onShutdown() override
React to shutdown of the freeplay event.
Static CAMP main event plugin metaclass collection class.
Definition: MainEventMetaclasses.h:30
virtual uint32 getEventNumber() override
Gets number of the main event (Is needed for the highscore management)
Binary serializer class.
Definition: BinarySerializer.h:35
virtual void onUpdateMusic(const qsf::Time &timePassed) override
Gets called when the main event gets an update call We use here a separate update method...
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 ...
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32