Emergency 20 Dokumentation  4.2.0
StatusOverlayData.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 //[-------------------------------------------------------]
15 
16 
17 //[-------------------------------------------------------]
18 //[ Namespace ]
19 //[-------------------------------------------------------]
20 namespace em5
21 {
22  namespace multiplayer
23  {
24 
25 
26  //[-------------------------------------------------------]
27  //[ Classes ]
28  //[-------------------------------------------------------]
33  class StatusOverlayData: public DataCacheComponentExistenceTrackingBase<StatusOverlayComponent>
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public methods ]
39  //[-------------------------------------------------------]
40  public:
41  StatusOverlayData(const qsf::Entity& targetEntity);
42  virtual ~StatusOverlayData();
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public virtual em5::multiplayer::DataCacheBase methods ]
47  //[-------------------------------------------------------]
48  public:
49  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) override;
50  virtual void updateData(qsf::game::BitStream& bitStream, bool force) override;
51  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) override;
52  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) override;
53 
54 
55  //[-------------------------------------------------------]
56  //[ Private data ]
57  //[-------------------------------------------------------]
58  private:
59  bool mIconFlagsChanged;
60  uint64 mIconFlags;
61  bool mBarChanged;
62  uint8 mVisibleBars;
63  std::unordered_map<uint8, uint8> mCurrentBarValues;
64  std::vector<uint16> mChangedBarValues;
65 
66  struct HistoryEntry
67  {
68  int32 tickCount;
69  bool mIconFlagsChanged;
70  uint64 mIconFlags;
71  bool mBarChanged;
72  uint8 mVisibleBars;
73  std::vector<uint16> mChangedBarValues;
74  };
75 
76  std::vector<HistoryEntry> mHistoryList;
77 
78 
79  };
80 
81 
82 //[-------------------------------------------------------]
83 //[ Namespace ]
84 //[-------------------------------------------------------]
85  } // multiplayer
86 } // em5
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
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.
virtual bool prepareForUpdate(const qsf::Entity &targetEntity, const qsf::Clock &clock) override
Prepares for an update.
EMERGENCY 5 entity with a status overlay component data cache for a single entity for multiplayer...
Definition: StatusOverlayData.h:33
Clock class.
Definition: Clock.h:33
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.
StatusOverlayData(const qsf::Entity &targetEntity)
unsigned char uint8
Definition: PlatformTypes.h:175
virtual void setData(const qsf::game::BitStream &bitStream, const int32 receivedHostTickCount) override
Reads the data from the bit stream.