Emergency 20 Dokumentation  4.2.0
InventoryData.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 <glm/gtc/quaternion.hpp>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  class InventoryComponent;
24 }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 namespace em5
31 {
32  namespace multiplayer
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
43  class InventoryData: public DataCacheComponentExistenceTrackingBase<InventoryComponent>
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public methods ]
49  //[-------------------------------------------------------]
50  public:
51  InventoryData(const qsf::Entity& targetEntity);
52  virtual ~InventoryData();
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
57  //[-------------------------------------------------------]
58  public:
59  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
60  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
61  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
62  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
63 
64 
65  //[-------------------------------------------------------]
66  //[ Private data ]
67  //[-------------------------------------------------------]
68  private:
69  uint64 mActiveEquipmentId;
70  bool mActiveEquipmentIdChanged;
71 
72  struct HistoryEntry
73  {
74  int32 tickCount;
75  uint64 mActiveEquipmentId;
76  bool mActiveEquipmentIdChanged;
77  };
78 
79  std::vector<HistoryEntry> mHistoryList;
80 
81 
82  };
83 
84 
85 //[-------------------------------------------------------]
86 //[ Namespace ]
87 //[-------------------------------------------------------]
88  } // multiplayer
89 } // em5
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
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.
uint64_t uint64
Definition: PlatformTypes.h:184
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
signed int int32
Definition: PlatformTypes.h:180
EMERGENCY 5 multiplayer data cache base class which tracks component existence.
Definition: DataCacheComponentExistenceTrackingBase.h:36
virtual void updateData(qsf::game::BitStream &bitStream, bool force) override
Updates the cache and writes any changed data to the given bit stream.
InventoryData(const qsf::Entity &targetEntity)
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 inventory component data cache for a single entity for multiplayer.
Definition: InventoryData.h:43