Emergency 20 Dokumentation  4.2.0
FadeEntityHandler.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 <vector>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23  namespace multiplayer
24  {
25 
26 
27  //[-------------------------------------------------------]
28  //[ Classes ]
29  //[-------------------------------------------------------]
35  {
36 
37 
38  //[-------------------------------------------------------]
39  //[ Public definitions ]
40  //[-------------------------------------------------------]
41  public:
43 
44 
45  //[-------------------------------------------------------]
46  //[ Public methods ]
47  //[-------------------------------------------------------]
48  public:
54 
59  virtual ~FadeEntityHandler();
60 
65  void onNewFadeEntity(uint64 entityId, const qsf::Time& fadeTime, bool fadeIn);
66 
67 
68  //[-------------------------------------------------------]
69  //[ Public virtual em5::multiplayer::OperationMessageHandler methods ]
70  //[-------------------------------------------------------]
71  public:
72  virtual void writeData(int32 currentTick, qsf::game::BitStream& bitStream) override;
73  virtual bool onHandleMessage(uint32 playerId, uint64 dataSize, const qsf::game::BitStream& bitStream) override;
74  virtual void applyData(int32 currentTick) override;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Private data ]
79  //[-------------------------------------------------------]
80  private:
81  std::vector<std::pair<int32, std::vector<FadeEntityData>>> mClientDataList;
82  std::unordered_map<int32, std::vector<FadeEntityData>> mHostDataList;
83 
84 
85  };
86 
87 
88 //[-------------------------------------------------------]
89 //[ Namespace ]
90 //[-------------------------------------------------------]
91  } // multiplayer
92 } // em5
Definition: ActionPriority.h:13
static const OperationMessage HANDLER_ID
Definition: FadeEntityHandler.h:42
virtual void writeData(int32 currentTick, qsf::game::BitStream &bitStream) override
Writes the stored data for the given tick into the bit stream.
EMERGENCY 5 base class for operation message handler.
Definition: OperationMessageHandler.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
OperationMessage
EMERGENCY 5 multiplayer operation message types.
Definition: OperationMessages.h:51
uint64_t uint64
Definition: PlatformTypes.h:184
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
virtual ~FadeEntityHandler()
Destructor.
EMERGENCY 5 handler for the FADE_ENTITY operation message.
Definition: FadeEntityHandler.h:34
signed int int32
Definition: PlatformTypes.h:180
virtual void applyData(int32 currentTick) override
Gets called when the received data should by applied.
FadeEntityHandler()
OperationMessage::FADE_ENTITY.
void onNewFadeEntity(uint64 entityId, const qsf::Time &fadeTime, bool fadeIn)
Add data about a new fade effect to the handler.
virtual bool onHandleMessage(uint32 playerId, uint64 dataSize, const qsf::game::BitStream &bitStream) override
Gets called when a operation message (handled by this handler) is received.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32