Open 3D Engine Multiplayer Gem API Reference  23.05.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

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
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
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

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

Const base type retriever.

Returns
value in const base type form
template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
const BASE_TYPE & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::GetLastSerializedValue ( ) const
inline

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

Returns
value in const base type form
template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
const BASE_TYPE & Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::GetPrevious ( ) const
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
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
template<typename BASE_TYPE , AZStd::size_t REWIND_SIZE>
Multiplayer::RewindableObject< BASE_TYPE, REWIND_SIZE >::operator const BASE_TYPE & ( ) const
inline

Const base type operator.

Returns
value in const base type form
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
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
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
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
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
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: