Emergency 20 Dokumentation  4.2.0
DataCacheBase.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 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
15 #include <boost/noncopyable.hpp>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class Clock;
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 EM5_API_EXPORT DataCacheBase : public boost::noncopyable
49  {
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
60  DataCacheBase(const qsf::Entity& entity);
61 
66  inline virtual ~DataCacheBase();
67 
72  virtual bool includeForPrepare(const int32 currentTickCount, bool entityIsVisible);
73 
81  virtual bool prepareForUpdate(const qsf::Entity& targetEntity, const qsf::Clock& clock) { return false; }
82 
87  virtual void updateData(qsf::game::BitStream& bitStream, bool force = false) = 0;
88 
93  virtual void setData(const qsf::game::BitStream& bitStream, const int32 receivedHostTickCount) = 0;
94 
99  virtual void interpolate(qsf::Entity& targetEntity, const qsf::Clock& clock, const int32 receivedHostTickCount) = 0;
100 
101 
102  //[-------------------------------------------------------]
103  //[ Protected data ]
104  //[-------------------------------------------------------]
105  protected:
107 
108 
109  };
110 
111 
112 //[-------------------------------------------------------]
113 //[ Namespace ]
114 //[-------------------------------------------------------]
115  } // multiplayer
116 } // em5
117 
118 
119 //[-------------------------------------------------------]
120 //[ Implementation ]
121 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 multiplayer data cache base class.
Definition: DataCacheBase.h:48
Entity class.
Definition: Entity.h:46
Clock class.
Definition: Clock.h:33
#define EM5_API_EXPORT
Definition: Export.h:28
uint64_t uint64
Definition: PlatformTypes.h:184
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
uint64 mEntityId
Definition: DataCacheBase.h:106
virtual bool prepareForUpdate(const qsf::Entity &targetEntity, const qsf::Clock &clock)
Prepares for an update.
Definition: DataCacheBase.h:81