Emergency 20 Dokumentation  4.2.0
DummyEvent.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:
52  DummyEvent();
53 
58  virtual ~DummyEvent();
59 
64  uint64 getTargetPersonId() const;
65 
70  void setTargetPerson(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 
96 
97  //[-------------------------------------------------------]
98  //[ Public virtual em5::FreeplayEvent methods ]
99  //[-------------------------------------------------------]
100  public:
101  virtual bool onStartup() override;
102  virtual void onShutdown() override;
103  virtual void onRun() override;
104  virtual bool onFailure(EventResult& eventResult) override;
105  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
106  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
107  virtual void hintCallback(Observer& hintObserver) override;
108  virtual const qsf::Entity* getFocusEntity() override;
109  virtual bool checkEventConfiguration() override;
110  virtual void serialize(qsf::BinarySerializer& serializer) override;
111 
112 
113  //[-------------------------------------------------------]
114  //[ Private methods ]
115  //[-------------------------------------------------------]
116  private:
117  void startObjectives(const qsf::Entity& targetEntity);
118  void startHintObservers(const qsf::Entity& targetEntity);
119 
124  bool checkCandidate(qsf::Entity* targetEntity);
125 
130  void delayedStartup(const qsf::MessageParameters& parameters);
131 
132 
133  //[-------------------------------------------------------]
134  //[ Private data ]
135  //[-------------------------------------------------------]
136  private:
137  uint64 mInjuredEntityId;
138  std::string mInjuryName;
139  qsf::Time mRunningDelay;
140  qsf::MessageProxy mMessageProxy;
141 
142 
143  //[-------------------------------------------------------]
144  //[ CAMP reflection system ]
145  //[-------------------------------------------------------]
146  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
147 
148 
149  };
150 
151 
152 //[-------------------------------------------------------]
153 //[ Namespace ]
154 //[-------------------------------------------------------]
155 } // em5
156 
157 
158 //[-------------------------------------------------------]
159 //[ CAMP reflection system ]
160 //[-------------------------------------------------------]
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
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
static const uint32 FREEPLAY_EVENT_ID
"em5::DummyEvent" unique freeplay event ID
Definition: DummyEvent.h:41
EMERGENCY 5 freeplay event "dummy".
Definition: DummyEvent.h:33
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