Emergency 20 Dokumentation  4.2.0
DlkLadderData.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 <glm/vec3.hpp>
18 
19 #include <vector>
20 
21 
22 //[-------------------------------------------------------]
23 //[ Forward declarations ]
24 //[-------------------------------------------------------]
25 namespace em5
26 {
27  class DlkLadderComponent;
28 }
29 namespace qsf
30 {
31  class Entity;
32  namespace game
33  {
34  class BitStream;
35  }
36 }
37 
38 
39 //[-------------------------------------------------------]
40 //[ Namespace ]
41 //[-------------------------------------------------------]
42 namespace em5
43 {
44  namespace multiplayer
45  {
46 
47 
48  //[-------------------------------------------------------]
49  //[ Classes ]
50  //[-------------------------------------------------------]
56  {
57 
58 
59  //[-------------------------------------------------------]
60  //[ Public methods ]
61  //[-------------------------------------------------------]
62  public:
63  DlkLadderData(const qsf::Entity& targetEntity);
64  virtual ~DlkLadderData();
65 
66 
67  //[-------------------------------------------------------]
68  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
69  //[-------------------------------------------------------]
70  public:
71  virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible) override { return true;}
72  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
73  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
74  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
75  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
76 
77 
78  //[-------------------------------------------------------]
79  //[ Private data ]
80  //[-------------------------------------------------------]
81  private:
83  glm::vec3 mTargetPosition;
84  bool mTargetPositionChanged;
85  uint8 mLastAnimationType;
86  bool mLastAnimationTypeChanged;
87 
88  // For client side only
89  struct HistoryEntry
90  {
91  int32 tickCount;
92  glm::vec3 mTargetPosition;
93  bool mTargetPositionChanged;
94  uint8 mLastAnimationType;
95  bool mLastAnimationTypeChanged;
96  };
97 
98  std::vector<HistoryEntry> mHistoryList;
99 
100 
101  };
102 
103 
104 //[-------------------------------------------------------]
105 //[ Namespace ]
106 //[-------------------------------------------------------]
107  } // multiplayer
108 } // em5
Definition: ActionPriority.h:13
EMERGENCY 5 multiplayer data cache base class.
Definition: DataCacheBase.h:48
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.
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
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: DlkLadderData.h:71
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 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.
DlkLadderData(const qsf::Entity &targetEntity)
EMERGENCY 5 entity with a dlk ladder component data cache for a single entity for multiplayer...
Definition: DlkLadderData.h:55
virtual void setData(const qsf::game::BitStream &bitStream, const int32 receivedHostTickCount) override
Reads the data from the bit stream.
unsigned char uint8
Definition: PlatformTypes.h:175