Emergency 20 Dokumentation  4.2.0
DynamicCollisionConverterComponent.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 PersonComponent;
22 }
23 
24 
25 //[-------------------------------------------------------]
26 //[ Namespace ]
27 //[-------------------------------------------------------]
28 namespace em5
29 {
30 
31 
32  //[-------------------------------------------------------]
33  //[ Classes ]
34  //[-------------------------------------------------------]
43  {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Public definitions ]
48  //[-------------------------------------------------------]
49  public:
50  static const uint32 COMPONENT_ID;
51 
52 
53  //[-------------------------------------------------------]
54  //[ Public methods ]
55  //[-------------------------------------------------------]
56  public:
65 
66 
67  //[-------------------------------------------------------]
68  //[ Public overridden methods ]
69  //[-------------------------------------------------------]
70  public:
75  virtual bool onStartup() override;
76 
81  virtual bool shouldBeTreatedAsStatic() const override;
82 
83 
84  //[-------------------------------------------------------]
85  //[ Private methods ]
86  //[-------------------------------------------------------]
87  private:
88  // specific methods for some types of entities that require specific rules
90  bool shouldCivilPersonBeTreatedAsStatic() const;
91  bool shouldCivilCarBeTreatedAsStatic() const;
93 
94 
95  //[-------------------------------------------------------]
96  //[ Private data ]
97  //[-------------------------------------------------------]
98  private:
99  qsf::WeakPtr<PersonComponent> mPersonComponent; //< Optional pointer to the person component of the entity. May legally be invalid (nullptr)
100 
101 
102  //[-------------------------------------------------------]
103  //[ CAMP reflection system ]
104  //[-------------------------------------------------------]
105  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
106 
107 
108  };
109 
110 
111 //[-------------------------------------------------------]
112 //[ Namespace ]
113 //[-------------------------------------------------------]
114 } // em5
115 
116 
117 //[-------------------------------------------------------]
118 //[ CAMP reflection system ]
119 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Specific variant of the QSF AI component that tracks for an entity whether it should be treated as a ...
Definition: DynamicCollisionConverterComponent.h:42
unsigned int uint32
Definition: PlatformTypes.h:181
DynamicCollisionConverterComponent(qsf::Prototype *prototype)
Constructor.
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
Definition: DynamicCollisionConverterComponent.h:42
static const uint32 COMPONENT_ID
"em5::DynamicCollisionConverterComponent" unique component ID
Definition: DynamicCollisionConverterComponent.h:50
virtual bool shouldBeTreatedAsStatic() const override
Overloaded version that considers that civil persons usually try to avoid themselves.
Prototype class.
Definition: Prototype.h:100
virtual bool onStartup() override
Overloaded startup to initialize weak pointers to other components.
QSF_CAMP_TYPE_NONCOPYABLE(qsf::ai::DynamicCollisionConverterComponent)