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