Emergency 20 Dokumentation  4.2.0
WaterDeepTypePolygonComponent.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 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
40  static const uint32 COMPONENT_ID;
41  static const uint32 WATER_DEEP_TYPE;
42 
44  {
47  DEEP_WATER
48  };
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
62  inline explicit WaterDeepTypePolygonComponent(qsf::Prototype* prototype);
63 
68  inline virtual ~WaterDeepTypePolygonComponent();
69 
70  void setWaterDeepType(WaterDeepType waterDeepType);
71  inline WaterDeepType getWaterDeepType() const;
72 
73 
74  //[-------------------------------------------------------]
75  //[ Public virtual qsf::Component methods ]
76  //[-------------------------------------------------------]
77  public:
78  virtual bool onStartup() override;
79 
80 
81  //[-------------------------------------------------------]
82  //[ Protected virtual qsf::Component methods ]
83  //[-------------------------------------------------------]
84  protected:
85  inline virtual bool implementsOnComponentPropertyChange() const override { return true;}
86  virtual void onComponentPropertyChange(const qsf::Component& component, uint32 propertyId) override;
87 
88 
89  //[-------------------------------------------------------]
90  //[ Protected virtual qsf::PolygonComponent methods ]
91  //[-------------------------------------------------------]
92  protected:
93  virtual const qsf::Color4& getPolygonDebugColor() const override;
94 
95 
96  //[-------------------------------------------------------]
97  //[ Private methods ]
98  //[-------------------------------------------------------]
99  private:
100  // Updates the values of the Collision component depending of the current water deep type
101  void updateCollisionComponentValues() const;
102 
103 
104  //[-------------------------------------------------------]
105  //[ Private data ]
106  //[-------------------------------------------------------]
107  private:
108  WaterDeepType mWaterDeepType;
109 
110 
111  //[-------------------------------------------------------]
112  //[ CAMP reflection system ]
113  //[-------------------------------------------------------]
114  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
115 
116 
117  };
118 
119 
120 //[-------------------------------------------------------]
121 //[ Namespace ]
122 //[-------------------------------------------------------]
123 } // em5
124 
125 
126 //[-------------------------------------------------------]
127 //[ Implementation ]
128 //[-------------------------------------------------------]
130 
131 
132 //[-------------------------------------------------------]
133 //[ CAMP reflection system ]
134 //[-------------------------------------------------------]
136 QSF_CAMP_TYPE_NONCOPYABLE(em5::WaterDeepTypePolygonComponent::WaterDeepType)
Definition: ActionPriority.h:13
Polygon component class.
Definition: PolygonComponent.h:44
static const uint32 COMPONENT_ID
"qsf::WaterDeepTypePolygonComponent" unique component ID
Definition: WaterDeepTypePolygonComponent.h:40
Abstract component class.
Definition: Component.h:105
Color class with red, green, blue and alpha component.
Definition: Color4.h:39
unsigned int uint32
Definition: PlatformTypes.h:181
WaterDeepType
Definition: WaterDeepTypePolygonComponent.h:43
#define EM5_API_EXPORT
Definition: Export.h:28
virtual bool implementsOnComponentPropertyChange() const override
Signal whether this component needs the "onComponentPropertyChange" callback at all.
Definition: WaterDeepTypePolygonComponent.h:85
#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
Definition: WaterDeepTypePolygonComponent.h:45
Prototype class.
Definition: Prototype.h:100
Definition: WaterDeepTypePolygonComponent.h:46
static const uint32 WATER_DEEP_TYPE
"WaterDeepType" unique class property ID inside the class
Definition: WaterDeepTypePolygonComponent.h:41
AI water polygon component class.
Definition: WaterDeepTypePolygonComponent.h:32