Emergency 20 Dokumentation  4.2.0
DivingSpotComponent.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 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class FreeplayEvent;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Classes ]
36  //[-------------------------------------------------------]
42  {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public definitions ]
47  //[-------------------------------------------------------]
48  public:
49  static const uint32 COMPONENT_ID;
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
63  explicit DivingSpotComponent(qsf::Prototype* prototype);
64 
69  virtual ~DivingSpotComponent();
70 
71  bool isIntact() const;
72  void setIntact(bool intact, FreeplayEvent* freeplayEvent);
73 
74  FreeplayEvent* getFreeplayEvent() const;
75 
80  qsf::Entity* spawnRandomEntityFromPool() const;
81 
82  uint64 getAlternativeTargetId() const;
83  void setAlternativeTargetId(uint64 alternativeTargetId);
84 
85 
86  //[-------------------------------------------------------]
87  //[ Public virtual qsf::Component methods ]
88  //[-------------------------------------------------------]
89  public:
90  virtual void onSetSimulating(bool simulating) override;
91  virtual void serialize(qsf::BinarySerializer& serializer) override;
92 
93 
94  //[-------------------------------------------------------]
95  //[ Private methods ]
96  //[-------------------------------------------------------]
97  private:
98  void enableParticleEffects(bool enable);
99 
100 
101  //[-------------------------------------------------------]
102  //[ Private data ]
103  //[-------------------------------------------------------]
104  private:
105  bool mIntact; // "true" if nobody visited this diving spot before
106  uint64 mAlternativeTargetId;
107  FreeplayEvent* mFreeplayEvent;
108 
109 
110  //[-------------------------------------------------------]
111  //[ CAMP reflection system ]
112  //[-------------------------------------------------------]
113  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
114 
115 
116  };
117 
118 
119 //[-------------------------------------------------------]
120 //[ Namespace ]
121 //[-------------------------------------------------------]
122 } // em5
123 
124 
125 //[-------------------------------------------------------]
126 //[ CAMP reflection system ]
127 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Abstract component class.
Definition: Component.h:105
Entity class.
Definition: Entity.h:46
Definition: DivingSpotComponent.h:41
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
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
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Prototype class.
Definition: Prototype.h:100
static const uint32 COMPONENT_ID
"em5::DivingSpotComponent" unique component ID
Definition: DivingSpotComponent.h:49
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
Binary serializer class.
Definition: BinarySerializer.h:35