This class holds the serialized state of another object (typically a game entity). More...
#include "State.hpp"
Public Member Functions | |
StateT () | |
Constructor for creating an empty StateT instance. More... | |
StateT (const StateT &Other, const ArrayT< uint8_t > &DeltaMessage) | |
Constructor for creating a state from another StateT instance and a delta message. More... | |
ArrayT< uint8_t > | GetDeltaMessage (const StateT &Other, bool Compress=true) const |
Creates a delta message from this state. More... | |
Static Public Member Functions | |
static bool | IsDeltaMessageEmpty (const ArrayT< uint8_t > &DeltaMessage) |
Returns whether a delta message created by GetDeltaMessage() is empty (no change to the state). More... | |
Friends | |
class | InStreamT |
class | OutStreamT |
This class holds the serialized state of another object (typically a game entity).
It is used in combination with the OutStreamT and InStreamT classes, which handle the serialization and deserialization. The delta messages created and taken by this class are intended for network transfer, disk storage, etc. Internally, the encapsulated state is kept as an array of raw bytes, and as such it is "opaque" – we don't have any idea of the meaning of the contained data.
|
inline |
Constructor for creating an empty StateT instance.
The constructed instance is typically used with an OutStreamT, filled indirectly in a call to e.g. BaseEntityT::Serialize(OutStreamT& Stream).
Constructor for creating a state from another StateT instance and a delta message.
Other | The other state to create this state from. |
DeltaMessage | The delta message that expresses how this state is different from Other. |
Creates a delta message from this state.
The delta message expresses how this state is different from another.
Other | The other state that the generated delta message is relative to. |
Compress | Whether the delta message should be RLE-compressed. |
|
static |
Returns whether a delta message created by GetDeltaMessage() is empty (no change to the state).