Emergency 20 Dokumentation  4.2.0
FollowMagnetLogic.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/ai/MovementModes.h"
14 
16 #include <qsf/job/JobProxy.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace qsf
24 {
25  class JobArguments;
26 }
27 
28 
29 //[-------------------------------------------------------]
30 //[ Namespace ]
31 //[-------------------------------------------------------]
32 namespace em5
33 {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public definitions ]
49  //[-------------------------------------------------------]
50  public:
51  static const uint32 GAMELOGIC_TYPE_ID; // "em5::FollowMagnetLogic" game logic type ID
52 
53 
54  //[-------------------------------------------------------]
55  //[ Public methods ]
56  //[-------------------------------------------------------]
57  public:
59 
60  void setTargetMagnet(uint64 magnetEntityId, const glm::vec3& relativeDistance = glm::vec3(0, 0, 0));
61  uint64 getTargetMagnetEntityId() const;
62 
63  void setMovementMode(MovementModes::Modes movementMode);
64  MovementModes::Modes getMovementMode() const;
65 
66 
67  //[-------------------------------------------------------]
68  //[ Public virtual qsf::GameLogic methods ]
69  //[-------------------------------------------------------]
70  public:
71  virtual bool onStartup() override;
72  virtual void onShutdown() override;
73 
74 
75  //[-------------------------------------------------------]
76  //[ Private methods ]
77  //[-------------------------------------------------------]
78  private:
79  // Job updates
80  void updateSimulation(const qsf::JobArguments& jobArguments);
81  void onInjured(const qsf::MessageParameters& parameters);
82 
83 
84  //[-------------------------------------------------------]
85  //[ Private definitions ]
86  //[-------------------------------------------------------]
87  private:
88  static const uint32 ACTION_PRIORITY;
89 
90 
91  //[-------------------------------------------------------]
92  //[ Private data ]
93  //[-------------------------------------------------------]
94  private:
95  qsf::JobProxy mSimulationJobProxy;
96  qsf::MessageProxy mOnInjuredProxy;
97  qsf::MessageProxy mOnContaminatedProxy;
98  uint64 mTargetMagnetEntityId;
99  glm::vec3 mRelativeDistance;
100  bool mIsInjured;
101  MovementModes::Modes mMovementMode;
102 
103 
104  //[-------------------------------------------------------]
105  //[ CAMP reflection system ]
106  //[-------------------------------------------------------]
107  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
108 
109 
110  };
111 
112 
113 //[-------------------------------------------------------]
114 //[ Namespace ]
115 //[-------------------------------------------------------]
116 } // em5
117 
118 
119 //[-------------------------------------------------------]
120 //[ CAMP reflection system ]
121 //[-------------------------------------------------------]
A game logic that lets entity drive to the side of the road when units on emergency operations ("Alar...
Definition: FollowMagnetLogic.h:43
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
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
static const uint32 GAMELOGIC_TYPE_ID
Definition: FollowMagnetLogic.h:51
uint64_t uint64
Definition: PlatformTypes.h:184
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
Modes
Definition: MovementModes.h:44
#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