Emergency 20 Dokumentation  4.2.0
FreeplayEventFactoryManager.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 #include <vector>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace boost
24 {
25  namespace property_tree
26  {
27  template <typename U, typename V, typename W>
28  class basic_ptree;
29  typedef basic_ptree<std::string, std::string, std::less<std::string> > ptree;
30  }
31 }
32 namespace em5
33 {
34  class FreeplayEventFactory;
35 }
36 
37 
38 //[-------------------------------------------------------]
39 //[ Namespace ]
40 //[-------------------------------------------------------]
41 namespace em5
42 {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Classes ]
47  //[-------------------------------------------------------]
53  {
54 
55 
56  //[-------------------------------------------------------]
57  //[ Friends ]
58  //[-------------------------------------------------------]
59  friend class FreeplaySystem; // May insert and remove freeplay events
60  friend class FreeplayEventPoolManager; // May create events
61 
62 
63  //[-------------------------------------------------------]
64  //[ Private definitions ]
65  //[-------------------------------------------------------]
66  private:
67  typedef std::vector<FreeplayEventFactory*> FactoryArray;
68 
69 
70  //[-------------------------------------------------------]
71  //[ Public methods ]
72  //[-------------------------------------------------------]
73  public:
79 
84  virtual ~FreeplayEventFactoryManager();
85 
99  FreeplayEventFactory* getRandomEventFactory(bool onlyMarkedAsStart) const;
100 
105  FreeplayEventFactory* getEventFactoryById(uint32 id) const;
106 
107  FreeplayEventFactory* getEventFactoryByIndex(uint32 index) const;
108 
109  inline const FactoryArray& getEventFactories() const { return mFactories; }
110 
111 
112  //[-------------------------------------------------------]
113  //[ Private static methods ]
114  //[-------------------------------------------------------]
115  private:
123  static FreeplayEventFactory* createFreeplayFactoryByName(const std::string& key);
124 
125 
126  //[-------------------------------------------------------]
127  //[ Private methods ]
128  //[-------------------------------------------------------]
129  private:
134  void clearFactoryArray();
135 
136 
137  //[-------------------------------------------------------]
138  //[ Private data ]
139  //[-------------------------------------------------------]
140  private:
141  FactoryArray mFactories;
142 
143 
144  };
145 
146 
147 //[-------------------------------------------------------]
148 //[ Namespace ]
149 //[-------------------------------------------------------]
150 } // em5
Definition: ActionPriority.h:13
Definition: DensityCalculator.h:24
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 freeplay event factory manager.
Definition: FreeplayEventFactoryManager.h:52
Abstract manager interface.
Definition: Manager.h:40
basic_ptree< std::string, std::string, std::less< std::string > > ptree
Definition: DensityCalculator.h:29
EMERGENCY 5 freeplay event pool manager.
Definition: FreeplayEventPoolManager.h:44
EMERGENCY 5 freeplay event factory base class.
Definition: FreeplayEventFactory.h:56
const FactoryArray & getEventFactories() const
Definition: FreeplayEventFactoryManager.h:109
EMERGENCY 5 freeplay system.
Definition: FreeplaySystem.h:55