Emergency 20 Dokumentation  4.2.0
ObjectDamageComponent.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 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
31  {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Public definitions ]
36  //[-------------------------------------------------------]
37  public:
38  static const uint32 COMPONENT_ID;
39 
40 
41  //[-------------------------------------------------------]
42  //[ Public methods ]
43  //[-------------------------------------------------------]
44  public:
52  inline explicit ObjectDamageComponent(qsf::Prototype* prototype);
53 
58  inline virtual ~ObjectDamageComponent();
59 
60 
61  //[-------------------------------------------------------]
62  //[ Public virtual em5::DamageComponent methods ]
63  //[-------------------------------------------------------]
64  public:
72  inline virtual bool isReadyForCleanup() const override;
73 
78  virtual void cleanup() override;
79 
80 
81  //[-------------------------------------------------------]
82  //[ Public virtual qsf::Component methods ]
83  //[-------------------------------------------------------]
84  public:
85  virtual bool onStartup() override;
86  virtual void serialize(qsf::BinarySerializer& serializer) override;
87 
88 
89  //[-------------------------------------------------------]
90  //[ Protected virtual em5::DamageComponent methods ]
91  //[-------------------------------------------------------]
92  protected:
93  virtual void onSetIntact() override;
94  virtual void onSetDamagedLevel1() override;
95  virtual void onSetDamagedLevel2() override;
96  virtual void onSetDestroyed() override;
97  virtual void onSetFireLifePercentage(float fireLifePercentage) override;
98  virtual void onFireStarted(FreeplayEvent* freeplayEvent) override;
99  virtual void onExplosion(FireComponent* fireComponent) override;
100 
101 
102  //[-------------------------------------------------------]
103  //[ Private methods ]
104  //[-------------------------------------------------------]
105  private:
106  void setDamageOverlaysActive(bool smutActive, bool emissiveActive);
107 
108 
109  //[-------------------------------------------------------]
110  //[ Private data ]
111  //[-------------------------------------------------------]
112  private:
113  qsf::JobProxy mFireFadeAnimationJobProxy;
114 
115 
116  //[-------------------------------------------------------]
117  //[ CAMP reflection system ]
118  //[-------------------------------------------------------]
119  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
120 
121 
122  };
123 
124 
125 //[-------------------------------------------------------]
126 //[ Namespace ]
127 //[-------------------------------------------------------]
128 } // em5
129 
130 
131 //[-------------------------------------------------------]
132 //[ Implementation ]
133 //[-------------------------------------------------------]
135 
136 
137 //[-------------------------------------------------------]
138 //[ CAMP reflection system ]
139 //[-------------------------------------------------------]
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
EMERGENCY 5 fire component class.
Definition: FireComponent.h:64
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
EMERGENCY 5 damage component class.
Definition: DamageComponent.h:49
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
static const uint32 COMPONENT_ID
"em5::ObjectDamageComponent" unique component ID
Definition: ObjectDamageComponent.h:38
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 deco object component class.
Definition: ObjectDamageComponent.h:30