Emergency 20 Dokumentation  4.2.0
VehicleCraneData.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 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class VehicleCraneComponent;
24 }
25 namespace qsf
26 {
27  class Entity;
28  namespace game
29  {
30  class BitStream;
31  }
32 }
33 
34 
35 //[-------------------------------------------------------]
36 //[ Namespace ]
37 //[-------------------------------------------------------]
38 namespace em5
39 {
40  namespace multiplayer
41  {
42 
43 
44  //[-------------------------------------------------------]
45  //[ Classes ]
46  //[-------------------------------------------------------]
52  {
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public methods ]
57  //[-------------------------------------------------------]
58  public:
59  VehicleCraneData(const qsf::Entity& targetEntity);
60  virtual ~VehicleCraneData();
61 
62 
63  //[-------------------------------------------------------]
64  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
65  //[-------------------------------------------------------]
66  public:
67  virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible) override { return true;}
68  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
69  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
70  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
71  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
72 
73 
74  //[-------------------------------------------------------]
75  //[ Private data ]
76  //[-------------------------------------------------------]
77  private:
79  glm::vec3 mTargetPosition;
80  bool mTargetPositionChanged;
81  uint8 mLastAnimationType;
82  bool mLastAnimationTypeChanged;
83  bool mStrapVisible;
84  uint8 mSequenceType;
85  bool mSequenceTypeChanged;
86  uint8 mMoveHookDistancePercentage; // It is a percentage value and currently only full percentaqge is used
87  bool mMoveHookDistancePercentageChanged;
88  uint64 mEntityIdLinkedToHook;
89  bool mEntityIdLinkedToHookChanged;
90 
91  // For client side only
92  struct HistoryEntry
93  {
94  int32 tickCount;
95  glm::vec3 mTargetPosition;
96  bool mTargetPositionChanged;
97  uint8 mLastAnimationType;
98  bool mLastAnimationTypeChanged;
99  bool mStrapVisible;
100  uint8 mSequenceType;
101  bool mSequenceTypeChanged;
102  uint8 mMoveHookDistancePercentage; // It is a percentage value and currently only full percentaqge is used
103  bool mMoveHookDistancePercentageChanged;
104  uint64 mEntityIdLinkedToHook;
105  bool mEntityIdLinkedToHookChanged;
106  };
107 
108  std::vector<HistoryEntry> mHistoryList;
109 
110 
111  };
112 
113 
114 //[-------------------------------------------------------]
115 //[ Namespace ]
116 //[-------------------------------------------------------]
117  } // multiplayer
118 } // em5
Definition: ActionPriority.h:13
VehicleCraneData(const qsf::Entity &targetEntity)
EMERGENCY 5 multiplayer data cache base class.
Definition: DataCacheBase.h:48
Entity class.
Definition: Entity.h:46
EMERGENCY 5 entity with a vehicle crane component data cache for a single entity for multiplayer...
Definition: VehicleCraneData.h:51
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.
Clock class.
Definition: Clock.h:33
virtual bool prepareForUpdate(const qsf::Entity &targetEntity, const qsf::Clock &clock) override
Prepares for an update.
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
Definition: PickupPersonByParamedicAction.h:21
virtual void setData(const qsf::game::BitStream &bitStream, const int32 receivedHostTickCount) override
Reads the data from the bit stream.
signed int int32
Definition: PlatformTypes.h:180
virtual void updateData(qsf::game::BitStream &bitStream, bool force) override
Updates the cache and writes any changed data to the given bit stream.
virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible) override
Returns if the data cache item should be generally included into the current update cycle...
Definition: VehicleCraneData.h:67
unsigned char uint8
Definition: PlatformTypes.h:175