Emergency 20 Dokumentation  4.2.0
PlaneCrashEvent.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/base/WeakPtr.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Namespace ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25 
26 
27  //[-------------------------------------------------------]
28  //[ Classes ]
29  //[-------------------------------------------------------]
35  {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Friends ]
40  //[-------------------------------------------------------]
41  friend class FreeplayEventMetaclasses2; // CAMP export of editable values for Game Design
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public definitions ]
46  //[-------------------------------------------------------]
47  public:
48  static const uint32 FREEPLAY_EVENT_ID;
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
60 
65  virtual ~PlaneCrashEvent();
66 
67 
68  //[-------------------------------------------------------]
69  //[ Public virtual em5::FreeplayEvent methods ]
70  //[-------------------------------------------------------]
71  public:
72  virtual bool onStartup() override;
73  virtual void onShutdown() override;
74  virtual void onRun() override;
75  virtual bool onFailure(EventResult& eventResult) override;
76  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
77  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
78  virtual void hintCallback(Observer& hintObserver) override;
79  virtual const qsf::Entity* getFocusEntity() override;
80  virtual bool checkEventConfiguration() override;
81  virtual void serialize(qsf::BinarySerializer& serializer) override;
82 
83 
84  //[-------------------------------------------------------]
85  //[ Private methods ]
86  //[-------------------------------------------------------]
87  private:
88  void startObjectives();
89  void startHintObservers();
90 
95  void activateLayer(const std::string& activate);
96 
101  void deactivateLayer(const std::string& deactivate);
102 
103  void onWreckFound(const qsf::MessageParameters& parameters);
104 
105  void setupPilotVictim();
106 
107  void onEboxRepaired(const qsf::MessageParameters& parameters);
108  void onAnyoneStartsToCutPlaneWreck(const qsf::MessageParameters& parameters);
109  void onPilotDiscovered(const qsf::MessageParameters& parameters);
110  void onScientistRescued(const qsf::MessageParameters& parameters);
111 
112 
113  //[-------------------------------------------------------]
114  //[ Private data ]
115  //[-------------------------------------------------------]
116  private:
117  bool mIsEnergyDisabled;
118  qsf::Time mWreckCuttingDuration;
119  qsf::Time mHint02WaitTime;
120  bool mHint01Triggered;
121  std::string mElectrocutedFiremanInjury;
122  std::string mScientistInjury;
123  std::string mPilotInjury;
124  qsf::MessageProxy mWreckFoundProxy;
125  qsf::MessageProxy mEboxRepairedProxy;
126  qsf::MessageProxy mStartToCutPlaneWreck;
127  qsf::MessageProxy mPilotDiscoveredProxy;
128  qsf::MessageProxy mScientistRescuedProxy;
129  qsf::WeakPtr<qsf::Entity> mWreckUndiscoveredCameraTarget;
130  qsf::WeakPtr<qsf::Entity> mDroneTarget;
131  qsf::WeakPtr<qsf::Entity> mPlaneWreck;
133  qsf::WeakPtr<qsf::Entity> mScientist;
134  qsf::WeakPtr<qsf::Entity> mScientistInPlane;
136  qsf::WeakPtr<qsf::Entity> mMinimapPolygonArea;
137  qsf::WeakPtr<qsf::Entity> mMinimapPolygonSearchArea;
138 
139 
140  //[-------------------------------------------------------]
141  //[ CAMP reflection system ]
142  //[-------------------------------------------------------]
143  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
144 
145 
146  };
147 
148 
149 //[-------------------------------------------------------]
150 //[ Namespace ]
151 //[-------------------------------------------------------]
152 } // em5
153 
154 
155 //[-------------------------------------------------------]
156 //[ CAMP reflection system ]
157 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Definition: FreeplayEvent.h:110
Emergency 5 freeplay event "munich pest scientist plane crash" EM5X_MINI04.
Definition: PlaneCrashEvent.h:34
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Message listener proxy class.
Definition: MessageProxy.h:47
Reason
Definition: EventSpreadReason.h:20
Static CAMP freeplay event plugin metaclass collection class.
Definition: FreeplayEventMetaclasses2.h:30
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
#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
static const uint32 FREEPLAY_EVENT_ID
"em5::PlaneCrashEvent" unique main event ID
Definition: PlaneCrashEvent.h:48
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
Binary serializer class.
Definition: BinarySerializer.h:35
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32