Open 3D Engine Multiplayer Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE > Class Template Reference

A simple serializable data container that keeps a history of previous values, and can fetch those old values on request. More...

#include <RewindableObject.h>

Public Member Functions

 RewindableObject (const BASE_TYPE &value)
 
 RewindableObject (const BASE_TYPE &value, AzNetworking::ConnectionId owningConnectionId)
 
 RewindableObject (const RewindableObject &rhs)
 
RewindableObjectoperator= (const BASE_TYPE &rhs)
 
RewindableObjectoperator= (const RewindableObject &rhs)
 
void SetOwningConnectionId (AzNetworking::ConnectionId owningConnectionId)
 
 operator const BASE_TYPE & () const
 
const BASE_TYPE & Get () const
 
const BASE_TYPE & GetPrevious () const
 
const BASE_TYPE & GetLastSerializedValue () const
 
BASE_TYPE & Modify ()
 
bool operator== (const BASE_TYPE &rhs) const
 
bool operator!= (const BASE_TYPE &rhs) const
 
bool Serialize (AzNetworking::ISerializer &serializer)
 

Detailed Description

template<typename BASE_TYPE, AZStd::size_t REWIND_SIZE>
class Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >

A simple serializable data container that keeps a history of previous values, and can fetch those old values on request.

Constructor & Destructor Documentation

◆ RewindableObject() [1/3]

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::RewindableObject ( const BASE_TYPE &  value)
inline

Constructor.

Parameters
valuebase type value to construct from

◆ RewindableObject() [2/3]

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::RewindableObject ( const BASE_TYPE &  value,
AzNetworking::ConnectionId  owningConnectionId 
)
inlineexplicit

Copy construct from underlying base type.

Parameters
valuebase type value to construct from
owningConnectionIdthe entity id of the owning object

◆ RewindableObject() [3/3]

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::RewindableObject ( const RewindableObject< BASE_TYPE, REWIND_SIZE > &  rhs)
inline

Copy construct from another rewindable history buffer.

Parameters
rhsrewindable history buffer to construct from

Member Function Documentation

◆ Get()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
const BASE_TYPE & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::Get
inline

Const base type retriever.

Returns
value in const base type form

◆ GetLastSerializedValue()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
const BASE_TYPE & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::GetLastSerializedValue
inline

Const base type retriever for value at last known serialized value or the nearest to it.

Returns
value in const base type form

◆ GetPrevious()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
const BASE_TYPE & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::GetPrevious
inline

Const base type retriever for one host frame behind Get() when contextually appropriate, otherwise identical to Get().

Returns
value in const base type form

◆ Modify()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
BASE_TYPE & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::Modify
inline

Base type retriever.

Returns
value in base type form

◆ operator const BASE_TYPE &()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::operator const BASE_TYPE &
inline

Const base type operator.

Returns
value in const base type form

◆ operator!=()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
bool Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::operator!= ( const BASE_TYPE &  rhs) const
inline

Inequality operator.

Parameters
rhsbase type value to compare against
Returns
boolean true if this != rhs

◆ operator=() [1/2]

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
RewindableObject< BASE_TYPE, REWIND_SIZE > & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::operator= ( const BASE_TYPE &  rhs)
inline

Assignment from underlying base type.

Parameters
rhsbase type value to assign from

◆ operator=() [2/2]

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
RewindableObject< BASE_TYPE, REWIND_SIZE > & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::operator= ( const RewindableObject< BASE_TYPE, REWIND_SIZE > &  rhs)
inline

Assignment from rewindable history buffer.

Parameters
rhsrewindable history buffer to assign from

◆ operator==()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
bool Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::operator== ( const BASE_TYPE &  rhs) const
inline

Equality operator.

Parameters
rhsbase type value to compare against
Returns
boolean true if this == rhs

◆ Serialize()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
bool Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::Serialize ( AzNetworking::ISerializer &  serializer)
inline

Base serialize method for all serializable structures or classes to implement

Parameters
serializerISerializer instance to use for serialization
Returns
boolean true for success, false for serialization failure

◆ SetOwningConnectionId()

template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
void Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::SetOwningConnectionId ( AzNetworking::ConnectionId  owningConnectionId)
inline

Sets the owning connectionId for the given rewindable object instance.

Parameters
owningConnectionIdthe new connectionId to use as the owning connectionId.

The documentation for this class was generated from the following files: