Emergency 20 Dokumentation  4.2.0
FairBomberEventFactory.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/time/Time.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Forward declarations ]
21 //[-------------------------------------------------------]
22 namespace qsf
23 {
24  class Entity;
25 }
26 
27 
28 //[-------------------------------------------------------]
29 //[ Namespace ]
30 //[-------------------------------------------------------]
31 namespace em5
32 {
33 
34 
35  //[-------------------------------------------------------]
36  //[ Classes ]
37  //[-------------------------------------------------------]
43  {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Public methods ]
48  //[-------------------------------------------------------]
49  public:
55 
60  virtual ~FairBomberEventFactory();
61 
62  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(BombTime, qsf::Time, mBombTime);
63  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(BombDefuseTime, qsf::Time, mBombDefuseTime);
64  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(EscapeTime, qsf::Time, mEscapeTime);
65  QSF_DEFINE_SIMPLE_GETTER_AND_SETTER(BombSpotTag, const std::string&, mBombSpotTag);
66 
67 
68  //[-------------------------------------------------------]
69  //[ Public virtual em5::FreeplayEventFactory methods ]
70  //[-------------------------------------------------------]
71  public:
72  virtual FreeplayEvent* tryTriggerEvent() override;
73 
74 
75  //[-------------------------------------------------------]
76  //[ Private methods ]
77  //[-------------------------------------------------------]
78  private:
79  std::pair<qsf::Entity*, qsf::Entity*> findCandidate() const;
80  qsf::Entity* findBombSpot(qsf::Entity& candidate) const;
81  bool checkBombSpot(qsf::Entity& candidate, qsf::Entity& bombSpot) const;
82 
83 
84  //[-------------------------------------------------------]
85  //[ Private data ]
86  //[-------------------------------------------------------]
87  private:
88  qsf::Time mBombTime;
89  qsf::Time mBombDefuseTime;
90  qsf::Time mEscapeTime;
91  std::string mBombSpotTag;
92 
93 
94  //[-------------------------------------------------------]
95  //[ CAMP reflection system ]
96  //[-------------------------------------------------------]
97  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
98 
99 
100  };
101 
102 
103 //[-------------------------------------------------------]
104 //[ Namespace ]
105 //[-------------------------------------------------------]
106 } // em5
107 
108 
109 //[-------------------------------------------------------]
110 //[ CAMP reflection system ]
111 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
#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
#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
Emergency 5 freeplay event factory for "fair bomber" 13.4.
Definition: FairBomberEventFactory.h:42
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32