![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
Base for all component state classes. More...
#include <ComponentState.h>
Public Member Functions | |
BaseComponentState (float time, COMPONENT_TYPE componenttype) | |
virtual | ~BaseComponentState () |
BaseComponentState (const BaseComponentState &other) noexcept | |
BaseComponentState (BaseComponentState &&other) noexcept | |
BaseComponentState & | operator= (const BaseComponentState &other) noexcept |
BaseComponentState & | operator= (BaseComponentState &&other) noexcept |
virtual DLLEXPORT void | AddDataToPacket (sf::Packet &packet, BaseComponentState *olderstate) const =0 |
Adds update data to a packet. More... | |
virtual DLLEXPORT bool | FillMissingData (BaseComponentState &otherstate)=0 |
Copies data to missing values in this state from another state. More... | |
bool | IsBitSet (uint8_t bitnum=0) const |
Returns true if bitnum bit is set in UpdatedFields. More... | |
void | SetBit (uint8_t bitnum=0) |
Sets bitnum bit in Updated. More... | |
void | SetAllBitsInUpdated () |
Public Attributes | |
float | StateTime |
COMPONENT_TYPE | ComponentType |
uint8_t | UpdatedFields = std::numeric_limits<uint8_t>::max() |
Base for all component state classes.
Definition at line 30 of file ComponentState.h.
|
inline |
Definition at line 32 of file ComponentState.h.
|
inlinevirtual |
Definition at line 35 of file ComponentState.h.
|
inlinenoexcept |
Definition at line 37 of file ComponentState.h.
|
inlinenoexcept |
Definition at line 42 of file ComponentState.h.
|
pure virtual |
Adds update data to a packet.
olderstate | The state against which this is compared. Or null if a full update is wanted |
|
pure virtual |
Copies data to missing values in this state from another state.
|
inline |
Returns true if bitnum bit is set in UpdatedFields.
BitNum | the index of the bit to set. Starts at 0 and last valid is 7 |
Definition at line 79 of file ComponentState.h.
|
inlinenoexcept |
Definition at line 47 of file ComponentState.h.
|
inlinenoexcept |
Definition at line 55 of file ComponentState.h.
|
inline |
Definition at line 91 of file ComponentState.h.
|
inline |
COMPONENT_TYPE Leviathan::BaseComponentState::ComponentType |
The component type. This is needed to handle the actual subclasses that have data without having to do virtual method calls to find matching types
Definition at line 104 of file ComponentState.h.
float Leviathan::BaseComponentState::StateTime |
The time this state was captured at This is used for rebuilding delta states. And on the client for interpolating between states
Definition at line 100 of file ComponentState.h.
uint8_t Leviathan::BaseComponentState::UpdatedFields = std::numeric_limits<uint8_t>::max() |
Some components have properties that don't change very often so here is reserved 8 bits to let the state object have more granularity as to which parts of it need to be sent over the network
Definition at line 109 of file ComponentState.h.