Emergency 20 Dokumentation  4.2.0
HiddenData.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 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class Entity;
24  namespace game
25  {
26  class BitStream;
27  }
28 }
29 
30 
31 //[-------------------------------------------------------]
32 //[ Namespace ]
33 //[-------------------------------------------------------]
34 namespace em5
35 {
36  namespace multiplayer
37  {
38 
39 
40  //[-------------------------------------------------------]
41  //[ Classes ]
42  //[-------------------------------------------------------]
47  class HiddenData: public DataCacheComponentExistenceTrackingBase<qsf::game::HiddenComponent>
48  {
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
55  HiddenData(const qsf::Entity& targetEntity);
56  virtual ~HiddenData();
57 
58 
59  //[-------------------------------------------------------]
60  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
61  //[-------------------------------------------------------]
62  public:
63  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
64  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
65  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
66  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
67 
68 
69  //[-------------------------------------------------------]
70  //[ Private data ]
71  //[-------------------------------------------------------]
72  private:
73  uint8 mHiddenType;
74  bool mHiddenTypeChanged;
75 
76  // For client side only
77  struct HistoryEntry
78  {
79  int32 tickCount;
80  uint8 mHiddenType;
81  bool mHiddenTypeChanged;
82  };
83 
84  std::vector<HistoryEntry> mHistoryList;
85 
86 
87  };
88 
89 
90 //[-------------------------------------------------------]
91 //[ Namespace ]
92 //[-------------------------------------------------------]
93  } // multiplayer
94 } // em5
Definition: ActionPriority.h:13
virtual void updateData(qsf::game::BitStream &bitStream, bool force) override
Updates the cache and writes any changed data to the given bit stream.
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
virtual void setData(const qsf::game::BitStream &bitStream, const int32 receivedHostTickCount) override
Reads the data from the bit stream.
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.
HiddenData(const qsf::Entity &targetEntity)
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
Definition: PickupPersonByParamedicAction.h:21
signed int int32
Definition: PlatformTypes.h:180
EMERGENCY 5 multiplayer data cache base class which tracks component existence.
Definition: DataCacheComponentExistenceTrackingBase.h:36
virtual bool prepareForUpdate(const qsf::Entity &targetEntity, const qsf::Clock &clock) override
Prepares for an update.
EMERGENCY 5 entity with a hidden component data cache for a single entity for multiplayer.
Definition: HiddenData.h:47
unsigned char uint8
Definition: PlatformTypes.h:175