Emergency 20 Dokumentation  4.2.0
DrunkenOverboardEvent.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 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
40  static const uint32 FREEPLAY_EVENT_ID;
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public methods ]
45  //[-------------------------------------------------------]
46  public:
52 
57  virtual ~DrunkenOverboardEvent();
58 
63  uint64 getTargetPersonId() const;
64 
69  void setTargetPersonId(uint64 targetPersonId);
70 
75  uint64 getTargetShipId() const;
76 
81  void setTargetShipId(uint64 targetShipId);
82 
83 
84  //[-------------------------------------------------------]
85  //[ Public virtual em5::FreeplayEvent methods ]
86  //[-------------------------------------------------------]
87  public:
88  virtual bool onStartup() override;
89  virtual void onShutdown() override;
90  virtual void onRun() override;
91  virtual bool onFailure(EventResult& eventResult) override;
92  virtual void updateFreeplayEvent(const qsf::Time& timePassed) override;
93  virtual bool addEntityToEvent(qsf::Entity& targetEntity, eventspreadreason::Reason eventSpreadReason, bool newReason) override;
94  virtual const qsf::Entity* getFocusEntity() override;
95  virtual bool checkEventConfiguration() override;
96  virtual void serialize(qsf::BinarySerializer& serializer) override;
97 
98 
99  //[-------------------------------------------------------]
100  //[ Private methods ]
101  //[-------------------------------------------------------]
102  private:
103  void startObjectives(const qsf::Entity& targetEntity);
104  void startHintObservers();
105  void onDivingSpotCreated(const qsf::MessageParameters& parameters);
106  void findEntityInDivingSpot(const qsf::MessageParameters& parameters);
107  void onTimeIsUp(const qsf::MessageParameters& parameters);
108 
109 
110  //[-------------------------------------------------------]
111  //[ Private data ]
112  //[-------------------------------------------------------]
113  private:
114  uint64 mTargetPersonEntityId;
115  uint64 mTargetShipEntityId;
116  uint64 mDivingSpotEntityId;
117  qsf::Time mMaxRunningTime;
118  qsf::MessageProxy mMessageProxy;
119  qsf::MessageProxy mTimerMessageProxy;
120 
121  // Internal
122  bool mIsPersonUnderwater;
123 
124 
125  //[-------------------------------------------------------]
126  //[ CAMP reflection system ]
127  //[-------------------------------------------------------]
128  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
129 
130 
131  };
132 
133 
134 //[-------------------------------------------------------]
135 //[ Namespace ]
136 //[-------------------------------------------------------]
137 } // em5
138 
139 
140 //[-------------------------------------------------------]
141 //[ CAMP reflection system ]
142 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Definition: FreeplayEvent.h:110
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Message listener proxy class.
Definition: MessageProxy.h:47
Reason
Definition: EventSpreadReason.h:20
uint64_t uint64
Definition: PlatformTypes.h:184
EMERGENCY 5 freeplay event "drunken overboard".
Definition: DrunkenOverboardEvent.h:32
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
#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
static const uint32 FREEPLAY_EVENT_ID
"em5::DrunkenOverboardEvent" unique freeplay event ID
Definition: DrunkenOverboardEvent.h:40
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
Binary serializer class.
Definition: BinarySerializer.h:35
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32