Emergency 20 Dokumentation  4.2.0
VehicleData.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 VehicleComponent;
26 }
27 namespace qsf
28 {
29  class Entity;
30  namespace game
31  {
32  class BitStream;
33  }
34 }
35 
36 
37 //[-------------------------------------------------------]
38 //[ Namespace ]
39 //[-------------------------------------------------------]
40 namespace em5
41 {
42  namespace multiplayer
43  {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Classes ]
48  //[-------------------------------------------------------]
56  class VehicleData : public DataCacheBase
57  {
58 
59 
60  //[-------------------------------------------------------]
61  //[ Public methods ]
62  //[-------------------------------------------------------]
63  public:
64  VehicleData(const qsf::Entity& targetEntity);
65  virtual ~VehicleData();
66 
67 
68  //[-------------------------------------------------------]
69  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
70  //[-------------------------------------------------------]
71  public:
72  virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible);
73  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
74  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
75  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
76  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
77 
78 
79  //[-------------------------------------------------------]
80  //[ Private data ]
81  //[-------------------------------------------------------]
82  private:
84  uint64 mSpecialEntityId;
85  bool mCanBeTowedFlag;
86 
87  // For client side only
88  struct HistoryEntry
89  {
90  int32 tickCount;
91  uint64 mSpecialEntityId;
92  bool mCanBeTowedFlag;
93  };
94 
95  std::vector<HistoryEntry> mHistoryList;
96 
97 
98  };
99 
100 
101 //[-------------------------------------------------------]
102 //[ Namespace ]
103 //[-------------------------------------------------------]
104  } // multiplayer
105 } // em5
Definition: ActionPriority.h:13
EMERGENCY 5 multiplayer data cache base class.
Definition: DataCacheBase.h:48
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible)
Returns if the data cache item should be generally included into the current update cycle...
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.
uint64_t uint64
Definition: PlatformTypes.h:184
Lightweight weak pointer implementation.
Definition: WeakPtr.h:133
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
VehicleData(const qsf::Entity &targetEntity)
Definition: PickupPersonByParamedicAction.h:21
virtual void updateData(qsf::game::BitStream &bitStream, bool force) override
Updates the cache and writes any changed data to the given bit stream.
signed int int32
Definition: PlatformTypes.h:180
virtual bool prepareForUpdate(const qsf::Entity &targetEntity, const qsf::Clock &clock) override
Prepares for an update.
virtual void setData(const qsf::game::BitStream &bitStream, const int32 receivedHostTickCount) override
Reads the data from the bit stream.
EMERGENCY 5 entity with a vehicle component data cache for a single entity for multiplayer.
Definition: VehicleData.h:56