Emergency 20 Dokumentation  4.2.0
SupportLegsComponent.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/audio/AudioProxy.h"
14 
16 #include <qsf/job/JobProxy.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Forward declarations ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24  namespace multiplayer
25  {
26  class SupportLegData;
27  }
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Classes ]
40  //[-------------------------------------------------------]
50  {
51 
52 
53  //[-------------------------------------------------------]
54  //[ Friends ]
55  //[-------------------------------------------------------]
56  friend class multiplayer::SupportLegData; // Needed for multiplay
57 
58 
59  //[-------------------------------------------------------]
60  //[ Public definitions ]
61  //[-------------------------------------------------------]
62  public:
63  static const uint32 COMPONENT_ID;
64 
66  {
70  SUPPORTLEGSSTATE_HIDDING_ANIMATION
71  };
72 
73 
74  //[-------------------------------------------------------]
75  //[ Public methods ]
76  //[-------------------------------------------------------]
77  public:
85  inline explicit SupportLegsComponent(qsf::Prototype* prototype);
86 
91  inline virtual ~SupportLegsComponent();
92 
93  inline const qsf::AssetProxy& getAnimationExtend() const;
94  inline void setAnimationExtend(const qsf::AssetProxy& skeleton);
95 
96  void startExtending();
97  void hideExtending();
98 
99  bool isAnimationPlaying();
100 
101 
102  //[-------------------------------------------------------]
103  //[ Public virtual qsf::Component methods ]
104  //[-------------------------------------------------------]
105  public:
106  virtual void serialize(qsf::BinarySerializer& serializer) override;
107 
108 
109  //[-------------------------------------------------------]
110  //[ Private methods ]
111  //[-------------------------------------------------------]
112  private:
113  void activateJob();
114  void deactivateJob();
115  void updateJob(const qsf::JobArguments& jobArguments);
116 
117 
118  //[-------------------------------------------------------]
119  //[ Private definitions ]
120  //[-------------------------------------------------------]
121  private:
122  typedef std::vector<uint64> EntityIdArray;
123 
124 
125  //[-------------------------------------------------------]
126  //[ Private data ]
127  //[-------------------------------------------------------]
128  private:
129  SupportLegsState mSupportLegsState;
130  EntityIdArray mSupportLegIds;
131  qsf::AssetProxy mAnimationExtend;
132 
133  // Internal
134  qsf::JobProxy mUpdateJobProxy;
135  AudioProxy mAudioProxy;
136 
137 
138  //[-------------------------------------------------------]
139  //[ CAMP reflection system ]
140  //[-------------------------------------------------------]
141  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
142 
143  public:
144  QSF_CAMP_ARRAY_INTERFACE_CLASS_WITH_VARIABLE(EntityIdArrayInterface, SupportLegsComponent, std::vector<uint64>, uint64);
145  EntityIdArrayInterface SupportLegsArray;
146 
147 
148  };
149 
150 
151 //[-------------------------------------------------------]
152 //[ Namespace ]
153 //[-------------------------------------------------------]
154 } // em5
155 
156 
157 //[-------------------------------------------------------]
158 //[ Implementation ]
159 //[-------------------------------------------------------]
160 #include "em5/component/vehicle/parts/SupportLegsComponent-inl.h"
161 
162 
163 //[-------------------------------------------------------]
164 //[ CAMP reflection system ]
165 //[-------------------------------------------------------]
167 QSF_CAMP_ARRAY_MAPPER_DEFINITION(em5::SupportLegsComponent::EntityIdArrayInterface)
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Abstract component class.
Definition: Component.h:105
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
SupportLegsState
Definition: SupportLegsComponent.h:65
Definition: AreaConfiguration.h:58
#define QSF_CAMP_ARRAY_INTERFACE_CLASS_WITH_VARIABLE(interfaceClassName, ownerType, variableType, elementType)
Definition: CampClass.h:241
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
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
Special emergency 5 units can must deploy support legs for starting work (To support optical stabilit...
Definition: SupportLegsComponent.h:49
QSF_CAMP_ARRAY_MAPPER_DEFINITION(qsf::ai::TrafficLightTimerComponent::ManagedTrafficLightList)
EMERGENCY 5 entity with a support leg component data cache for a single entity for multiplayer...
Definition: SupportLegData.h:55
Asset proxy class.
Definition: AssetProxy.h:57
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
static const uint32 COMPONENT_ID
"em5::SupportLegsComponent" unique component ID
Definition: SupportLegsComponent.h:63
Extended audio proxy for easier multiplay usage.
Definition: AudioProxy.h:47
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Definition: SupportLegsComponent.h:69
Definition: SupportLegsComponent.h:67
Prototype class.
Definition: Prototype.h:100
Binary serializer class.
Definition: BinarySerializer.h:35