Emergency 20 Dokumentation  4.2.0
ComplexFireEvent.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 
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Friends ]
39  //[-------------------------------------------------------]
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public definitions ]
45  //[-------------------------------------------------------]
46  public:
47  static const uint32 FREEPLAY_EVENT_ID;
48 
49  typedef std::vector<qsf::Entity*> EntityArray;
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
61 
66  virtual ~ComplexFireEvent();
67 
72  uint32 getDeadPersonsToFail() const;
73 
78  void setDeadPersonsToFail(uint32 personsToFail);
79 
84  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(PersonDamage, bool, mPersonDamage);
85  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(PersonMissing, bool, mPersonMissing);
86  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(Injuries, const std::string&, mInjuries);
87 
88 
89  //[-------------------------------------------------------]
90  //[ Public virtual em5::FreeplayEvent methods ]
91  //[-------------------------------------------------------]
92  public:
93  virtual bool onStartup() override;
94  virtual void onShutdown() override;
95  virtual void onRun() override;
96  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
97  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
98  virtual void hintCallback(Observer& hintObserver) override;
99  virtual const qsf::Entity* getFocusEntity() override;
100  virtual bool checkEventConfiguration() override;
101  virtual void serialize(qsf::BinarySerializer& serializer) override;
102 
103 
104  //[-------------------------------------------------------]
105  //[ Private methods ]
106  //[-------------------------------------------------------]
107  private:
108  void startObjectives(const qsf::Entity& targetEntity);
109  void startHintObservers(const qsf::Entity& targetEntity);
110  bool inflameEntity(qsf::Entity& entity);
111  qsf::Entity* spawnEntity(qsf::Entity& spawnpoint);
112  void onAllPersonsFound();
113 
114 
115  //[-------------------------------------------------------]
116  //[ Private data ]
117  //[-------------------------------------------------------]
118  private:
119  uint64 mMetaEntityId;
120  EntityArray mInflameEntities;
121  EntityArray mSpawnPointEntities;
122  uint32 mDeadPersonsToFail;
123  bool mPersonDamage;
124  bool mPersonMissing;
125  std::string mInjuries;
126 
127  // Intern
128  bool mAllPersonsFound;
129  qsf::MessageProxy mMissingPersonMessageProxy;
130  qsf::Entity* mIconEntity;
131  std::vector<uint64> mMissingPersonEntityIds;
132 
133 
134  //[-------------------------------------------------------]
135  //[ CAMP reflection system ]
136  //[-------------------------------------------------------]
137  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
138 
139 
140  };
141 
142 
143 //[-------------------------------------------------------]
144 //[ Namespace ]
145 //[-------------------------------------------------------]
146 } // em5
147 
148 
149 //[-------------------------------------------------------]
150 //[ CAMP reflection system ]
151 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 observer base class.
Definition: Observer.h:41
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
EMERGENCY 5 freeplay event factory for "complex fire event".
Definition: ComplexFireEventFactory.h:41
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 freeplay event "complex fire".
Definition: ComplexFireEvent.h:33
Message listener proxy class.
Definition: MessageProxy.h:47
Reason
Definition: EventSpreadReason.h:20
uint64_t uint64
Definition: PlatformTypes.h:184
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
#define QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(name, type, variable)
Definition: PropertyHelper.h:16
static const uint32 FREEPLAY_EVENT_ID
"em5::ComplexFireEventFactory" unique freeplay event ID
Definition: ComplexFireEvent.h:47
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
std::vector< qsf::Entity * > EntityArray
Definition: ComplexFireEvent.h:49
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