Emergency 20 Dokumentation  4.2.0
DiverLogic.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 #include <qsf/job/JobProxy.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Namespace ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25 
26 
27  //[-------------------------------------------------------]
28  //[ Classes ]
29  //[-------------------------------------------------------]
35  {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Public definitions ]
40  //[-------------------------------------------------------]
41  public:
42  static const uint32 GAMELOGIC_TYPE_ID; // "em5::DiverLogic" game logic type ID
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public methods ]
47  //[-------------------------------------------------------]
48  public:
49  DiverLogic();
50 
51  bool isSwimming() const;
52  bool isCarryingPerson() const;
53  float getSwimmingOffset() const;
54 
55  void giveCarryOffsetToCarriedPerson();
56 
57  void setWalkSpeed(qsf::UnsignedFloat speed);
58  void setSwimSpeed(qsf::UnsignedFloat speed);
59 
60 
61  //[-------------------------------------------------------]
62  //[ Public virtual qsf::GameLogic methods ]
63  //[-------------------------------------------------------]
64  public:
65  virtual bool onStartup() override;
66  virtual void onShutdown() override;
67 
68 
69  //[-------------------------------------------------------]
70  //[ Private methods ]
71  //[-------------------------------------------------------]
72  private:
73  // Job update
74  void updateSimulation(const qsf::JobArguments& jobArguments);
75 
76  void updateMovementSpeed();
77 
78 
79  //[-------------------------------------------------------]
80  //[ Private data ]
81  //[-------------------------------------------------------]
82  private:
83  qsf::JobProxy mSimulationJobProxy;
84  bool mIsSwimming;
85  float mSwimmingOffset;
86  qsf::UnsignedFloat mWalkSpeed;
87  qsf::UnsignedFloat mSwimSpeed;
88 
89 
90  //[-------------------------------------------------------]
91  //[ CAMP reflection system ]
92  //[-------------------------------------------------------]
93  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
94 
95 
96  };
97 
98 
99 //[-------------------------------------------------------]
100 //[ Namespace ]
101 //[-------------------------------------------------------]
102 } // em5
103 
104 
105 //[-------------------------------------------------------]
106 //[ CAMP reflection system ]
107 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
static const uint32 GAMELOGIC_TYPE_ID
Definition: DiverLogic.h:42
Carry person logic.
Definition: CarryPersonLogic.h:33
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
#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
Diver logic.
Definition: DiverLogic.h:34
Definition: UnsignedFloat.h:33