Emergency 20 Dokumentation  4.2.0
Activity.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 <qsf/asset/AssetProxy.h>
16 #include <qsf/forward/BoostPTree.h>
18 
19 #include <boost/noncopyable.hpp>
20 #include <boost/container/flat_map.hpp>
21 
22 #include <vector>
23 
24 
25 //[-------------------------------------------------------]
26 //[ Namespace ]
27 //[-------------------------------------------------------]
28 namespace em5
29 {
30 
31 
32  //[-------------------------------------------------------]
33  //[ Classes ]
34  //[-------------------------------------------------------]
39  class Activity : public boost::noncopyable
40  {
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public definitions ]
45  //[-------------------------------------------------------]
46  public:
47  struct State
48  {
50  std::vector<ActivityStep*> mSteps;
51  };
52 
53 
54  //[-------------------------------------------------------]
55  //[ Public methods ]
56  //[-------------------------------------------------------]
57  public:
62  inline explicit Activity(uint32 id);
63 
68  inline ~Activity();
69 
70  void clear();
71 
73 
74  inline const qsf::AssetProxy& getSourceAssetProxy() const;
75  void setSourceAssetProxy(const qsf::AssetProxy& assetProxy);
76 
77  inline uint32 getId() const;
78 
79  inline uint32 getInitialStateId() const;
80  inline const State* getStateById(uint32 id) const;
81 
82  inline uint32 getLoadVersion() const;
83 
84 
85  //[-------------------------------------------------------]
86  //[ Private definitions ]
87  //[-------------------------------------------------------]
88  private:
89  typedef boost::container::flat_map<uint32, State> StateMap;
90 
91 
92  //[-------------------------------------------------------]
93  //[ Private data ]
94  //[-------------------------------------------------------]
95  private:
96  uint32 mId;
97  qsf::AssetProxy mSourceAssetProxy;
98  uint32 mLoadVersion;
99 
100  qsf::NamedIdentifier mInitialState;
101  StateMap mStates;
102 
103 
104  };
105 
106 
107 //[-------------------------------------------------------]
108 //[ Namespace ]
109 //[-------------------------------------------------------]
110 } // em5
111 
112 
113 //[-------------------------------------------------------]
114 //[ Implementation ]
115 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
uint32 getInitialStateId() const
Definition: Activity-inl.h:36
Definition: Activity.h:47
const qsf::AssetProxy & getSourceAssetProxy() const
Definition: Activity-inl.h:31
unsigned int uint32
Definition: PlatformTypes.h:181
const State * getStateById(uint32 id) const
Definition: Activity-inl.h:41
void setSourceAssetProxy(const qsf::AssetProxy &assetProxy)
qsf::NamedIdentifier mName
Definition: Activity.h:49
Activity(uint32 id)
Constructor.
Definition: Activity-inl.h:14
Asset proxy class.
Definition: AssetProxy.h:57
void loadFromBoostPTree(const boost::property_tree::ptree &pTree)
uint32 getLoadVersion() const
Definition: Activity-inl.h:47
std::vector< ActivityStep * > mSteps
Definition: Activity.h:50
uint32 getId() const
Definition: Activity-inl.h:26
~Activity()
Destructor.
Definition: Activity-inl.h:21
Definition: DensityCalculator.h:29
Activity class.
Definition: Activity.h:39
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34