Emergency 20 Dokumentation  4.2.0
FleeFromFireLogic.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 #include <qsf/job/JobProxy.h>
15 
16 
17 //[-------------------------------------------------------]
18 //[ Forward declarations ]
19 //[-------------------------------------------------------]
20 namespace qsf
21 {
22  class JobArguments;
23 }
24 
25 
26 //[-------------------------------------------------------]
27 //[ Namespace ]
28 //[-------------------------------------------------------]
29 namespace em5
30 {
31 
32 
33  //[-------------------------------------------------------]
34  //[ Classes ]
35  //[-------------------------------------------------------]
41  {
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public definitions ]
46  //[-------------------------------------------------------]
47  public:
48  static const uint32 GAMELOGIC_TYPE_ID; // "em5::FleeFromFireLogic" game logic type ID
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
56  void receiveFireEnergyFromSource(qsf::Entity& sourceEntity, float amountDamage);
57 
58 
59  //[-------------------------------------------------------]
60  //[ Public virtual qsf::GameLogic methods ]
61  //[-------------------------------------------------------]
62  public:
63  virtual bool onStartup() override;
64  virtual void onShutdown() override;
65 
66 
67  //[-------------------------------------------------------]
68  //[ Private methods ]
69  //[-------------------------------------------------------]
70  private:
71  // Job updates
72  void updateSimulation(const qsf::JobArguments& jobArguments);
73  void resetFleeTimer();
74 
75 
76  //[-------------------------------------------------------]
77  //[ Private data ]
78  //[-------------------------------------------------------]
79  private:
80  qsf::JobProxy mSimulationJobProxy;
81  qsf::Time mTimeToFlee;
82  qsf::Time mTimeWithoutFireDamage;
83  qsf::WeakPtr<qsf::Entity> mSourceEntity;
84  float mAmountDamage;
85 
86 
87  //[-------------------------------------------------------]
88  //[ CAMP reflection system ]
89  //[-------------------------------------------------------]
90  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
91 
92 
93  };
94 
95 
96 //[-------------------------------------------------------]
97 //[ Namespace ]
98 //[-------------------------------------------------------]
99 } // em5
100 
101 
102 //[-------------------------------------------------------]
103 //[ CAMP reflection system ]
104 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
static const uint32 GAMELOGIC_TYPE_ID
Definition: FleeFromFireLogic.h:48
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
#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
Fleeing from fire.
Definition: FleeFromFireLogic.h:40
Game logic base class.
Definition: GameLogic.h:44
virtual bool onStartup() override
Startup the game logic.
void receiveFireEnergyFromSource(qsf::Entity &sourceEntity, float amountDamage)
virtual void onShutdown() override
Shutdown the game logic.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32