Emergency 20 Dokumentation  4.2.0
BoatFireEventFactory.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 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class Entity;
24  class Layer;
25 }
26 
27 
28 //[-------------------------------------------------------]
29 //[ Namespace ]
30 //[-------------------------------------------------------]
31 namespace em5
32 {
33 
34 
35  //[-------------------------------------------------------]
36  //[ Classes ]
37  //[-------------------------------------------------------]
48  {
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
60 
65  virtual ~BoatFireEventFactory();
66 
67  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(PersonsOnDeckChance, float, mPersonsOnDeckChance);
68  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(ShipOnFireChance, float, mShipOnFireChance);
69  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(UseOnlyShipsFromLayer, bool, mUseOnlyShipsFromLayer);
70  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(DifficultyTags, const std::string&, mDifficultyTags);
71 
72 
73  //[-------------------------------------------------------]
74  //[ Public virtual em5::FreeplayEventFactory methods ]
75  //[-------------------------------------------------------]
76  public:
77  virtual FreeplayEvent* tryTriggerEvent() override;
78 
79 
80  //[-------------------------------------------------------]
81  //[ Private methods ]
82  //[-------------------------------------------------------]
83  private:
84  qsf::Entity* findCandidate() const;
85  bool checkCandidate(qsf::Entity& entity) const;
86  bool isBigShip(qsf::Entity& entity) const;
87  bool isBigShip(qsf::Layer& eventLayer);
88  bool checkIfNeededUnitsAreAvailable() const;
89 
90  bool checkCandidateLayer(const qsf::Layer& layer) const;
91  qsf::Layer* findCandidateLayer() const;
92 
93 
94  //[-------------------------------------------------------]
95  //[ Private data ]
96  //[-------------------------------------------------------]
97  private:
98  std::string mDifficultyTags;
99  float mPersonsOnDeckChance;
100  float mShipOnFireChance;
101  bool mUseOnlyShipsFromLayer;
102  std::string mBaseLayer;
103  std::string mEventLayer;
104 
105 
106  //[-------------------------------------------------------]
107  //[ CAMP reflection system ]
108  //[-------------------------------------------------------]
109  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
110 
111 
112  };
113 
114 
115 //[-------------------------------------------------------]
116 //[ Namespace ]
117 //[-------------------------------------------------------]
118 } // em5
119 
120 
121 //[-------------------------------------------------------]
122 //[ CAMP reflection system ]
123 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
Layer class.
Definition: Layer.h:56
#define EM5_API_EXPORT
Definition: Export.h:28
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 "boat fire event".
Definition: BoatFireEventFactory.h:47
#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
#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