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