Emergency 20 Dokumentation  4.2.0
LayerCleanup.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 #include <OGRE/Math/Simple/OgreAabb.h>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class Layer;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Classes ]
36  //[-------------------------------------------------------]
43  {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Public definitions ]
48  //[-------------------------------------------------------]
49  public:
50  static const uint32 GAMELOGIC_TYPE_ID; // "em5::LayerCleanup" game logic type ID
51 
52 
53  //[-------------------------------------------------------]
54  //[ Public static methods ]
55  //[-------------------------------------------------------]
56  public:
57  static void createLayerCleanup(qsf::Layer& layer, qsf::Layer* replacementLayer = nullptr);
58 
59 
60  //[-------------------------------------------------------]
61  //[ Public methods ]
62  //[-------------------------------------------------------]
63  public:
64  LayerCleanup();
65 
66  void init(qsf::Layer& layer, qsf::Layer* replacementLayer = nullptr);
67 
68 
69  //[-------------------------------------------------------]
70  //[ Protected virtual em5::Cleanup methods ]
71  //[-------------------------------------------------------]
72  protected:
73  virtual CleanupResult readyForCleanupCheap() const override;
74  virtual Cleanup::CleanupResult onReadyForCleanupCheap() const override;
75  virtual ExecuteResult onExecuteCleanup() override;
76 
77 
78  //[-------------------------------------------------------]
79  //[ Private methods ]
80  //[-------------------------------------------------------]
81  private:
82  void calculateLayerBoundingBox();
83  bool isLayerVisible() const;
84 
85 
86  //[-------------------------------------------------------]
87  //[ Private data ]
88  //[-------------------------------------------------------]
89  private:
90  qsf::Layer* mLayer;
91  qsf::Layer* mReplacementLayer;
92  Ogre::Aabb mLayerBoundingBox;
93 
94 
95  //[-------------------------------------------------------]
96  //[ CAMP reflection system ]
97  //[-------------------------------------------------------]
98  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
99 
100 
101  };
102 
103 
104 //[-------------------------------------------------------]
105 //[ Namespace ]
106 //[-------------------------------------------------------]
107 } // em5
108 
109 
110 //[-------------------------------------------------------]
111 //[ CAMP reflection system ]
112 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Layer class.
Definition: Layer.h:56
unsigned int uint32
Definition: PlatformTypes.h:181
CleanupResult
Definition: Cleanup.h:45
ExecuteResult
Definition: Cleanup.h:52
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: PickupPersonByParamedicAction.h:21
#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
Cleanup base class.
Definition: Cleanup.h:37
Cleanup for layers They are de-activated when all entities in there are not visible.
Definition: LayerCleanup.h:42
static const uint32 GAMELOGIC_TYPE_ID
Definition: LayerCleanup.h:50