Emergency 20 Dokumentation  4.2.0
SpawnGroup.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 #include <qsf/forward/BoostPTree.h>
18 
19 #include <boost/noncopyable.hpp>
20 
21 
22 //[-------------------------------------------------------]
23 //[ Forward declarations ]
24 //[-------------------------------------------------------]
25 namespace em5
26 {
27  class CivilistSpawnPointComponent;
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Classes ]
40  //[-------------------------------------------------------]
45  class EM5_API_EXPORT SpawnGroup : public boost::noncopyable
46  {
47 
48 
49  //[-------------------------------------------------------]
50  //[ Friends ]
51  //[-------------------------------------------------------]
52  friend class SpawnGroupManager;
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public definitions ]
57  //[-------------------------------------------------------]
58  public:
60  {
61  float mHourOfDay;
63  };
64 
65 
66  //[-------------------------------------------------------]
67  //[ Public methods ]
68  //[-------------------------------------------------------]
69  public:
74  explicit SpawnGroup(uint32);
75 
80  ~SpawnGroup();
81 
82  const qsf::NamedIdentifier& getId() const;
83 
84  bool loadFromBoostPTree(const boost::property_tree::ptree& pTree);
85 
86  void updateCurrentLimit(const LimitDependencyProperties& properties);
87 
88 
89  //[-------------------------------------------------------]
90  //[ Private methods ]
91  //[-------------------------------------------------------]
92  private:
93  void setId(const qsf::NamedIdentifier& id);
94 
95 
96  //[-------------------------------------------------------]
97  //[ Private data ]
98  //[-------------------------------------------------------]
99  private:
100  // Configuration
102  uint32 mDefaultLimit;
103  qsf::LinearGradientFunction<float> mSpawnRateByHour;
104  qsf::LinearGradientFunction<float> mSpawnRateByRainIntensity;
105 
106  // Current state
107  uint32 mCurrentNumber;
108  uint32 mCurrentLimit;
109  std::vector<CivilistSpawnPointComponent*> mSpawnPoints;
110 
111 
112  };
113 
114 
115 //[-------------------------------------------------------]
116 //[ Namespace ]
117 //[-------------------------------------------------------]
118 } // em5
Definition: ActionPriority.h:13
float mRainIntensity
Definition: SpawnGroup.h:62
Spawn group manager.
Definition: SpawnGroupManager.h:52
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Spawn group class.
Definition: SpawnGroup.h:45
Definition: DensityCalculator.h:29
float mHourOfDay
Definition: SpawnGroup.h:61
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34