Emergency 20 Dokumentation  4.2.0
BoatData.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 
15 #include <qsf/base/WeakPtr.h>
16 
17 #include <vector>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25  class BoatComponent;
26 }
27 namespace qsf
28 {
29  class Entity;
30  class TransformComponent;
31  namespace game
32  {
33  class BitStream;
34  }
35 }
36 
37 
38 //[-------------------------------------------------------]
39 //[ Namespace ]
40 //[-------------------------------------------------------]
41 namespace em5
42 {
43  namespace multiplayer
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Classes ]
49  //[-------------------------------------------------------]
54  class BoatData: public DataCacheBase
55  {
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public methods ]
60  //[-------------------------------------------------------]
61  public:
62  BoatData(const qsf::Entity& targetEntity);
63  virtual ~BoatData();
64 
65 
66  //[-------------------------------------------------------]
67  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
68  //[-------------------------------------------------------]
69  public:
70  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
71  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
72  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
73  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
74 
75 
76  //[-------------------------------------------------------]
77  //[ Private data ]
78  //[-------------------------------------------------------]
79  private:
80  qsf::WeakPtr<BoatComponent> mComponent;
81  bool mRadarEnabled;
82  bool mPropellerParticleEnabled;
83  bool mLakeIdChanged;
84  uint64 mLakeId;
85 
86  // For client side only
87  struct HistoryEntry
88  {
89  int32 tickCount;
90  bool mRadarEnabled;
91  bool mPropellerParticleEnabled;
92  bool mLakeIdChanged;
93  uint64 mLakeId;
94  };
95 
96  std::vector<HistoryEntry> mHistoryList;
97 
98 
99  };
100 
101 
102 //[-------------------------------------------------------]
103 //[ Namespace ]
104 //[-------------------------------------------------------]
105  } // multiplayer
106 } // em5
Definition: ActionPriority.h:13
EMERGENCY 5 multiplayer data cache base class.
Definition: DataCacheBase.h:48
Entity class.
Definition: Entity.h:46
virtual bool prepareForUpdate(const qsf::Entity &targetEntity, const qsf::Clock &clock) override
Prepares for an update.
Clock class.
Definition: Clock.h:33
virtual void interpolate(qsf::Entity &targetEntity, const qsf::Clock &clock, const int32 receivedHostTickCount) override
Does any interpolation steps needed to apply the cached data to the entity.
virtual void setData(const qsf::game::BitStream &bitStream, const int32 receivedHostTickCount) override
Reads the data from the bit stream.
uint64_t uint64
Definition: PlatformTypes.h:184
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
virtual void updateData(qsf::game::BitStream &bitStream, bool force) override
Updates the cache and writes any changed data to the given bit stream.
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
Definition: PickupPersonByParamedicAction.h:21
EMERGENCY 5 entity with a boat component data cache for a single entity for multiplayer.
Definition: BoatData.h:54
signed int int32
Definition: PlatformTypes.h:180
BoatData(const qsf::Entity &targetEntity)