Emergency 20 Dokumentation  4.2.0
BoatComponent.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 
15 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21  class WaterCannonComponent;
22  class SpawnPointComponent;
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 COMPONENT_ID;
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
62  explicit BoatComponent(qsf::Prototype* prototype);
63 
68  virtual ~BoatComponent();
69 
74  uint64 getLakeId() const;
75  void setLakeId(uint64 lakeId);
76 
81  void enableLights(bool enable);
82 
87  bool isPropellerParticlesEnabled() const;
88  void enablePropellerParticles(bool enable);
89 
94  uint64 getRadarEntityId() const;
95  void setRadarEntityId(uint64 craneEntityId);
96 
101  bool isRadarEnabled() const;
102  void enableRadar(bool enable);
103 
108  WaterCannonComponent* getWaterCannonComponent() const;
109 
114  const EntityIdArray& getSpawnPointIds() const;
115 
120  SpawnPointComponent* getRandomSpawnPointComponent() const;
121 
122 
123  //[-------------------------------------------------------]
124  //[ Public virtual qsf::Component methods ]
125  //[-------------------------------------------------------]
126  public:
127  virtual void serialize(qsf::BinarySerializer& serializer) override;
128  virtual bool onStartup() override;
129 
130 
131  //[-------------------------------------------------------]
132  //[ Protected virtual em5::DamageComponent methods ]
133  //[-------------------------------------------------------]
134  protected:
135  virtual void onSetDestroyed() override;
136  virtual void onFireStarted(FreeplayEvent* freeplayEvent) override;
137  virtual void onFireStopped() override;
138 
139 
140  //[-------------------------------------------------------]
141  //[ Private definitions ]
142  //[-------------------------------------------------------]
143  private:
144  typedef std::vector<uint64> EntityIdArray;
145 
146 
147  //[-------------------------------------------------------]
148  //[ Private methods ]
149  //[-------------------------------------------------------]
150  private:
151  void updateSinkAnimation(const qsf::JobArguments& arguments);
152 
153 
154  //[-------------------------------------------------------]
155  //[ Private data ]
156  //[-------------------------------------------------------]
157  private:
158  uint64 mLakeId;
159  uint64 mRadarEntityId;
160 
161  // Lights
162  EntityIdArray mVehicleLightIds;
163  bool mLightEnabled;
164 
165  // Particles
166  EntityIdArray mPropellerParticleIds;
167  bool mPropellerParticleEnabled;
168 
169  bool mRadarEnabled;
170 
171  // Spawn points
172  EntityIdArray mDrowningSpawnPointIds;
173 
174  // Job proxy
175  qsf::JobProxy mSinkAnimationJobProxy;
176  float mSinkAnimationSecondsPassed;
177  AudioProxy mAudioProxy;
178 
179  // Signal sounds
180  AudioProxy mSirenSFX;
181  bool mIsSirenSFXSet;
182 
183 
184  //[-------------------------------------------------------]
185  //[ CAMP reflection system ]
186  //[-------------------------------------------------------]
187  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
188 
189  public:
190  EntityIdArrayInterface VehicleLightsArray;
191  EntityIdArrayInterface DrowningSpawnPointArray;
192  EntityIdArrayInterface PropellerParticlesArray;
193 
194 
195  };
196 
197 
198 //[-------------------------------------------------------]
199 //[ Namespace ]
200 //[-------------------------------------------------------]
201 } // em5
202 
203 
204 //[-------------------------------------------------------]
205 //[ CAMP reflection system ]
206 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Vehicle component base class.
Definition: VehicleComponent.h:49
uint64_t uint64
Definition: PlatformTypes.h:184
EMERGENCY 5 boat component class.
Definition: BoatComponent.h:40
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
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
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
EMERGENCY 5 entities can spawn from this point. It has a list of valid entities which can spawn from ...
Definition: SpawnPointComponent.h:49
static const uint32 COMPONENT_ID
"em5::BoatComponent" unique component ID
Definition: BoatComponent.h:48
Prototype class.
Definition: Prototype.h:100
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
Binary serializer class.
Definition: BinarySerializer.h:35
EMERGENCY 5 water cannon component. Consists in a cannon part with this component and an optional can...
Definition: WaterCannonComponent.h:43