Emergency 20 Dokumentation  4.2.0
PullObjectLogic.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 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
15 #include <qsf/job/JobProxy.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace qsf
24 {
25  class Entity;
26 }
27 
28 
29 //[-------------------------------------------------------]
30 //[ Namespace ]
31 //[-------------------------------------------------------]
32 namespace em5
33 {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
47  {
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public definitions ]
52  //[-------------------------------------------------------]
53  public:
54  static const uint32 GAMELOGIC_TYPE_ID; // "em5::PullObjectLogic" game logic type ID
55 
56 
57  //[-------------------------------------------------------]
58  //[ Public methods ]
59  //[-------------------------------------------------------]
60  public:
66 
74  bool isPullingObject() const;
75 
83  qsf::Entity* getPulledObject() const;
84 
92  void setPulledObject(qsf::Entity* entity);
93 
94 
95  //[-------------------------------------------------------]
96  //[ Public virtual qsf::GameLogic methods ]
97  //[-------------------------------------------------------]
98  public:
99  virtual bool onStartup() override;
100  virtual void onShutdown() override;
101 
102 
103  //[-------------------------------------------------------]
104  //[ Private methods ]
105  //[-------------------------------------------------------]
106  private:
107  void updateSimulation(const qsf::JobArguments&);
108  void onPersonInjured(const qsf::MessageParameters& parameters);
109 
110 
111  //[-------------------------------------------------------]
112  //[ Private data ]
113  //[-------------------------------------------------------]
114  private:
115  qsf::JobProxy mSimulationJobProxy;
116  qsf::WeakPtr<qsf::Entity> mPulledEntity;
117  qsf::MessageProxy mMessageProxyInjured;
118 
119 
120  //[-------------------------------------------------------]
121  //[ CAMP reflection system ]
122  //[-------------------------------------------------------]
123  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
124 
125 
126  };
127 
128 
129 //[-------------------------------------------------------]
130 //[ Namespace ]
131 //[-------------------------------------------------------]
132 } // em5
133 
134 
135 //[-------------------------------------------------------]
136 //[ CAMP reflection system ]
137 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
static const uint32 GAMELOGIC_TYPE_ID
Definition: PullObjectLogic.h:54
Job proxy class.
Definition: JobProxy.h:51
Pull object logic.
Definition: PullObjectLogic.h:46
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
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
Game logic base class.
Definition: GameLogic.h:44