Emergency 20 Dokumentation  4.2.0
ActivitySystem.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/activity/Activity.h"
14 
15 #include <qsf/asset/AssetProxy.h>
16 #include <qsf/base/System.h>
19 
20 
21 //[-------------------------------------------------------]
22 //[ Forward declarations ]
23 //[-------------------------------------------------------]
24 namespace em5
25 {
26  class ActivityStepFactory;
27 }
28 
29 
30 //[-------------------------------------------------------]
31 //[ Namespace ]
32 //[-------------------------------------------------------]
33 namespace em5
34 {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Classes ]
39  //[-------------------------------------------------------]
47  class ActivitySystem : public qsf::System
48  {
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
60 
65  virtual ~ActivitySystem();
66 
67  inline Activity* getActivityByAsset(const qsf::AssetProxy& assetProxy);
68 
69  void reloadActivities();
70 
72 
73 
74  //[-------------------------------------------------------]
75  //[ Public virtual qsf::System methods ]
76  //[-------------------------------------------------------]
77  public:
78  inline virtual const char* getName() const override;
79 
80  //[-------------------------------------------------------]
81  //[ Lifecycle ]
82  //[-------------------------------------------------------]
83  virtual bool onStartup(bool serverMode) override;
84  virtual void onShutdown() override;
85 
86 
87  //[-------------------------------------------------------]
88  //[ Private definitions ]
89  //[-------------------------------------------------------]
90  private:
92 
93 
94  //[-------------------------------------------------------]
95  //[ Private methods ]
96  //[-------------------------------------------------------]
97  private:
98  bool loadActivityByAsset(Activity& activity, const qsf::AssetProxy& assetProxy);
99  Activity* loadActivityByAsset(const qsf::AssetProxy& assetProxy);
100 
101 
102  //[-------------------------------------------------------]
103  //[ Private data ]
104  //[-------------------------------------------------------]
105  private:
106  ActivityManager mActivityManager;
107  ActivityStepFactory* mActivityStepFactory;
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 //[ Implementation ]
127 //[-------------------------------------------------------]
129 
130 
131 //[-------------------------------------------------------]
132 //[ CAMP reflection system ]
133 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Activity step factory.
Definition: ActivityStepFactory.h:42
virtual void onShutdown() override
Shutdown the system.
Activity * getActivityByAsset(const qsf::AssetProxy &assetProxy)
Definition: ActivitySystem-inl.h:20
ActivityStepFactory & getActivityStepFactory() const
Definition: ActivitySystem-inl.h:30
Asset proxy class.
Definition: AssetProxy.h:57
Abstract system class.
Definition: System.h:48
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
virtual ~ActivitySystem()
Destructor.
ActivitySystem()
Default constructor.
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
Activity class.
Definition: Activity.h:39
virtual bool onStartup(bool serverMode) override
Startup the system.
Activity system.
Definition: ActivitySystem.h:47
virtual const char * getName() const override
Get the name of the system.
Definition: ActivitySystem-inl.h:41