Emergency 20 Dokumentation  4.2.0
BuildingFireEventFactory.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 
16 #include <qsf/math/EnumBitmask.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Forward declarations ]
21 //[-------------------------------------------------------]
22 namespace em5
23 {
24  class BuildingComponent;
25 }
26 namespace qsf
27 {
28  class Entity;
29 }
30 
31 
32 //[-------------------------------------------------------]
33 //[ Namespace ]
34 //[-------------------------------------------------------]
35 namespace em5
36 {
37 
38 
39  //[-------------------------------------------------------]
40  //[ Classes ]
41  //[-------------------------------------------------------]
47  {
48 
49 
50  //[-------------------------------------------------------]
51  //[ Public definitions ]
52  //[-------------------------------------------------------]
53  public:
54  enum class SearchFlag
55  {
56  PERSONS_AT_WINDOW,
57  PERSONS_INSIDE,
58  INDUSTRIAL_PLANT,
59  DEFECTIVE_EBOX,
60  EVACUATE_NEIGHBOR_HOUSE
61  };
63 
64 
65  //[-------------------------------------------------------]
66  //[ Public static methods ]
67  //[-------------------------------------------------------]
68  public:
69  static qsf::Entity* findCandidate(const std::string& difficultyTags, const std::string& eventTag, const SearchFlags& searchFlags);
70 
71 
72  //[-------------------------------------------------------]
73  //[ Public methods ]
74  //[-------------------------------------------------------]
75  public:
81 
86  virtual ~BuildingFireEventFactory();
87 
88  QSF_DEFINE_FLAG_GETTER_AND_SETTER(PersonsAtWindow, mSearchFlags, SearchFlag::PERSONS_AT_WINDOW);
89  QSF_DEFINE_FLAG_GETTER_AND_SETTER(PersonsInside, mSearchFlags, SearchFlag::PERSONS_INSIDE);
90  QSF_DEFINE_FLAG_GETTER_AND_SETTER(IndustrialPlant, mSearchFlags, SearchFlag::INDUSTRIAL_PLANT);
91  QSF_DEFINE_FLAG_GETTER_AND_SETTER(DefectEbox, mSearchFlags, SearchFlag::DEFECTIVE_EBOX);
92 
93  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(TrappedPersonWithPlague, bool, mTrappedPersonWithPlague);
94  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(Explosion, bool, mExplosion);
95  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(DifficultyTags, const std::string&, mDifficultyTags);
96  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(EvacuateNeighborHouseChance, float, mEvacuateNeighborHouseChance)
97  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(SpawnFromConnectedSpanwpoolsChance, float, mSpawnFromConnectedSpawnpoolsChance)
98  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(UseAmbientLayer, bool, mUseAmbientLayer)
99 
100 
101  //[-------------------------------------------------------]
102  //[ Public virtual em5::FreeplayEventFactory methods ]
103  //[-------------------------------------------------------]
104  public:
105  virtual FreeplayEvent* tryTriggerEvent() override;
106 
107 
108  //[-------------------------------------------------------]
109  //[ Private data ]
110  //[-------------------------------------------------------]
111  private:
112  SearchFlags mSearchFlags;
113  bool mTrappedPersonWithPlague;
114  bool mExplosion;
115  float mEvacuateNeighborHouseChance;
116  float mSpawnFromConnectedSpawnpoolsChance;
117  bool mUseAmbientLayer;
118  std::string mDifficultyTags;
119 
120  // Internal
121  std::string mLayerName;
122 
123 
124  //[-------------------------------------------------------]
125  //[ CAMP reflection system ]
126  //[-------------------------------------------------------]
127  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
128 
129 
130  };
131 
132 
133 //[-------------------------------------------------------]
134 //[ Namespace ]
135 //[-------------------------------------------------------]
136 } // em5
137 
138 
139 //[-------------------------------------------------------]
140 //[ CAMP reflection system ]
141 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
#define EM5_API_EXPORT
Definition: Export.h:28
Definition: AreaConfiguration.h:58
qsf::EnumBitmask< uint8, SearchFlag > SearchFlags
Definition: BuildingFireEventFactory.h:62
#define QSF_DEFINE_FLAG_GETTER_AND_SETTER(name, variable, flag)
Definition: PropertyHelper.h:24
Definition: PickupPersonByParamedicAction.h:21
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
EMERGENCY 5 freeplay event factory for "building fire event".
Definition: BuildingFireEventFactory.h:46
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
EMERGENCY 5 freeplay event factory base class.
Definition: FreeplayEventFactory.h:56
SearchFlag
Definition: BuildingFireEventFactory.h:54
#define QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(name, type, variable)
Definition: PropertyHelper.h:16
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66