Emergency 20 Dokumentation  4.2.0
SpawnGroupManager.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/job/JobProxy.h>
18 
19 #include <boost/container/flat_map.hpp>
20 
21 #include <vector>
22 
23 
24 //[-------------------------------------------------------]
25 //[ Forward declarations ]
26 //[-------------------------------------------------------]
27 namespace em5
28 {
29  class CivilistSpawnPointComponent;
30 }
31 namespace qsf
32 {
33  class Entity;
34  class Transform;
35 }
36 
37 
38 //[-------------------------------------------------------]
39 //[ Namespace ]
40 //[-------------------------------------------------------]
41 namespace em5
42 {
43 
44 
45  //[-------------------------------------------------------]
46  //[ Classes ]
47  //[-------------------------------------------------------]
52  class EM5_API_EXPORT SpawnGroupManager : public qsf::ElementManager<uint32, SpawnGroup>
53  {
54 
55 
56  //[-------------------------------------------------------]
57  //[ Public definitions ]
58  //[-------------------------------------------------------]
59  public:
62 
63 
64  //[-------------------------------------------------------]
65  //[ Public methods ]
66  //[-------------------------------------------------------]
67  public:
73 
78  virtual ~SpawnGroupManager();
79 
80  void createStartupPopulations() const;
81 
82  bool isDebugShown() const;
83  void setDebug(bool debug);
84 
85 
86  //[-------------------------------------------------------]
87  //[ Private methods ]
88  //[-------------------------------------------------------]
89  private:
90  SpawnGroup* createSpawnGroup(const qsf::NamedIdentifier& id);
91  void loadSpawnGroupDefinitions();
92 
93  void updateJob(const qsf::JobArguments& jobArgs);
94 
95  void updateCountersForAllGroups() const;
96 
97  void getStartupPopulationPoints(uint32 count, uint32 worldIndex, uint32 laneTypeId, std::vector<qsf::Transform>& outPoints) const;
98  void createStartupPopulation(uint32 spawnGroupId, uint32 laneTypeId, const std::string& spawnPoolName) const;
99 
100  qsf::Entity* trySpawnEntityFrom(CivilistSpawnPointComponent& spawnPointComponent, uint32 spawnGroupId);
101 
102 
103  //[-------------------------------------------------------]
104  //[ Private data ]
105  //[-------------------------------------------------------]
106  private:
107  qsf::JobProxy mJobProxy;
108 
109  qsf::DebugDrawProxy mDebugDrawProxy;
110  bool mShowDebug;
111 
112 
113  };
114 
115 
116 //[-------------------------------------------------------]
117 //[ Namespace ]
118 //[-------------------------------------------------------]
119 } // em5
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
Spawn group manager.
Definition: SpawnGroupManager.h:52
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Element manager class template.
Definition: ElementManager.h:71
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
Debug draw proxy class.
Definition: DebugDrawProxy.h:46
Spawn group class.
Definition: SpawnGroup.h:45
static const qsf::NamedIdentifier CIVIL_PERSONS_DEFAULT_GROUP
"CivilPersonsDefaultGroup" spawn group name
Definition: SpawnGroupManager.h:60
EMERGENCY 5 civilist spawn point component base class.
Definition: CivilistSpawnPointComponent.h:32
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
static const qsf::NamedIdentifier CIVIL_VEHICLES_DEFAULT_GROUP
"CivilVehiclesDefaultGroup" spawn group name
Definition: SpawnGroupManager.h:61