Emergency 20 Dokumentation  4.2.0
BuriedPersonEvent.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 
16 #include <qsf/time/Time.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Namespace ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public definitions ]
39  //[-------------------------------------------------------]
40  public:
41  static const uint32 FREEPLAY_EVENT_ID;
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public methods ]
46  //[-------------------------------------------------------]
47  public:
53 
58  virtual ~BuriedPersonEvent();
59 
64  uint64 getTargetPersonId() const;
65 
70  void setTargetPerson(const qsf::Entity& entity);
71 
76  const std::string& getInjuryName() const;
77 
82  void setInjuryName(const std::string& injuryName);
83 
88  float getRunningDelay() const;
89 
94  void setRunningDelay(float runningDelay);
95 
100  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(EventLayer, const std::string&, mEventLayer);
101  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(IsHidden, bool, mIsHidden);
102 
103 
104  //[-------------------------------------------------------]
105  //[ Public virtual em5::FreeplayEvent methods ]
106  //[-------------------------------------------------------]
107  public:
108  virtual bool onStartup() override;
109  virtual void onShutdown() override;
110  virtual void onRun() override;
111  virtual bool onFailure(EventResult& eventResult) override;
112  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
113  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
114  virtual void hintCallback(Observer& hintObserver) override;
115  virtual const qsf::Entity* getFocusEntity() override;
116  virtual bool checkEventConfiguration() override;
117  virtual void serialize(qsf::BinarySerializer& serializer) override;
118 
119 
120  //[-------------------------------------------------------]
121  //[ Private methods ]
122  //[-------------------------------------------------------]
123  private:
124  void startObjectives(const qsf::Entity& targetEntity);
125  void startHintObservers(const qsf::Entity& targetEntity);
126 
131  bool checkCandidate(qsf::Entity* targetEntity);
132 
133  void activateLayer(const std::string& layerName);
134  void deactivateLayer(const std::string& layerName);
135 
136  void onBuriedFound(const qsf::MessageParameters& parameters);
137 
138 
139  //[-------------------------------------------------------]
140  //[ Private data ]
141  //[-------------------------------------------------------]
142  private:
143  uint64 mInjuredEntityId;
144  uint64 mBuryObjectEntityId;
145  std::string mInjuryName;
146  qsf::Time mRunningDelay;
147  qsf::MessageProxy mBuriedFoundMessageProxy;
148  std::string mHintLowLifeEnergyName;
149  std::string mHintLowHealthEnergyName;
150  std::string mEventLayer;
151  bool mIsHidden;
152  qsf::Entity* mIconEntity;
153 
154 
155  //[-------------------------------------------------------]
156  //[ CAMP reflection system ]
157  //[-------------------------------------------------------]
158  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
159 
160 
161  };
162 
163 
164 //[-------------------------------------------------------]
165 //[ Namespace ]
166 //[-------------------------------------------------------]
167 } // em5
168 
169 
170 //[-------------------------------------------------------]
171 //[ CAMP reflection system ]
172 //[-------------------------------------------------------]
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
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 freeplay event "buried person".
Definition: BuriedPersonEvent.h:33
Message listener proxy class.
Definition: MessageProxy.h:47
Reason
Definition: EventSpreadReason.h:20
static const uint32 FREEPLAY_EVENT_ID
"em5::BuriedPersonEvent" unique freeplay event ID
Definition: BuriedPersonEvent.h:41
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
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