Emergency 20 Dokumentation  4.2.0
EventHelper.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/time/Time.h>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class Color4;
24  class Entity;
25  class Map;
26  class TransformComponent;
27  namespace game
28  {
29  class EventTagComponent;
30  class EventTagManagerComponent;
31  }
32 }
33 
34 
35 //[-------------------------------------------------------]
36 //[ Namespace ]
37 //[-------------------------------------------------------]
38 namespace em5
39 {
40 
41 
42  //[-------------------------------------------------------]
43  //[ Classes ]
44  //[-------------------------------------------------------]
49  class EM5_API_EXPORT EventHelper : public boost::noncopyable
50  {
51 
52 
53  //[-------------------------------------------------------]
54  //[ Public static methods ]
55  //[-------------------------------------------------------]
56  public:
57  static qsf::Entity* findSpawnPoint(const qsf::StringHash& tag);
58  static qsf::Entity* spawnEntity(qsf::Entity& spawnpoint, const qsf::Time& fadeTime = qsf::Time::fromSeconds(1.0f));
59 
60  static void copyPosition(const qsf::Entity& reference, qsf::Entity& target);
61 
62  static bool activateEventLayer(const std::string& layerName);
63  static bool isLayerVisible(const qsf::Layer& layer);
64  static bool calculateMapBoundingBox(const qsf::Map& map, glm::vec3& resultMin, glm::vec3& resultMax);
65 
66 
67  //[-------------------------------------------------------]
68  //[ Public methods ]
69  //[-------------------------------------------------------]
70  public:
75  explicit EventHelper(FreeplayEvent& freeplayEvent);
76 
81  inline ~EventHelper();
82 
83  void makeMissingPerson(qsf::Entity& entity, const qsf::StringHash& injuryHash, bool isDead);
84  void makeInjuredPerson(qsf::Entity& entity, const std::string& injury, bool addObjectives = true);
85  void makeDrownedPerson(qsf::Entity& entity, bool addObjectives);
86  void makeRescuablePerson(qsf::Entity& entity);
87  void makeTweetPerson(qsf::Entity& entity, bool active);
88 
89  void buryPersonsUnderLightDebris(qsf::Entity& debrisEntity, bool makeMissing = false);
90  void buryPersonsUnderHeavyDebris(qsf::Entity& debrisEntity, bool makeMissing = false);
91  void buryPersonsUnderDebris(qsf::Entity& debrisEntity, uint32 objectiveId, bool makeMissing);
92 
93  qsf::Entity* createEventIconCircleArea(const qsf::Entity& entity, float radius, float maxOffset);
94  void removeEventIcon(qsf::Entity& entity);
95 
96  qsf::Entity* getRandomEventEntity(bool showHidden = false);
97 
98 
99  //[-------------------------------------------------------]
100  //[ Private static methods ]
101  //[-------------------------------------------------------]
102  private:
103  static bool checkSpawnPoint(qsf::Entity& targetEntity);
104 
105 
106  //[-------------------------------------------------------]
107  //[ Private data ]
108  //[-------------------------------------------------------]
109  private:
110  FreeplayEvent& mFreeplayEvent;
111 
112 
113  };
114 
115 
116 //[-------------------------------------------------------]
117 //[ Namespace ]
118 //[-------------------------------------------------------]
119 } // em5
120 
121 
122 //[-------------------------------------------------------]
123 //[ Implementation ]
124 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
Map class.
Definition: Map.h:93
Layer class.
Definition: Layer.h:56
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: PickupPersonByParamedicAction.h:21
Definition: Injuries.h:26
EMERGENCY 5 event helper.
Definition: EventHelper.h:49
static Time fromSeconds(float seconds)
Definition: Time-inl.h:74
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
Compile time string hash class.
Definition: StringHash.h:59
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32