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