Rebel Fork Framework
Urho3D::NetworkValueVector< T, Traits > Class Template Reference

Similar to NetworkValue, except each frame contains an array of elements. More...

#include <Urho3D/Replica/NetworkValue.h>

Inheritance diagram for Urho3D::NetworkValueVector< T, Traits >:
Urho3D::Detail::NetworkValueBase

Public Types

using ValueSpan = ea::span< const T >
 
using InterpolatedValueSpan = Detail::InterpolatedConstSpan< T, Traits >
 

Public Member Functions

void Resize (unsigned size, unsigned capacity)
 
unsigned Size () const
 Return dynamic size of the vector.
 
ea::span< T > SetUninitialized (NetworkFrame frame)
 Set value and return uninitialized buffer to be filled.
 
void Set (NetworkFrame frame, ValueSpan value)
 Set value for given frame if possible.
 
ea::optional< ValueSpan > GetRaw (NetworkFrame frame) const
 Return raw value at given frame.
 
ValueSpan GetClosestRaw (NetworkFrame frame) const
 Return closest valid raw value, if possible. Prior values take precedence.
 
InterpolatedValueSpan SampleValid (const NetworkTime &time, float snapThreshold=M_LARGE_VALUE) const
 

Private Member Functions

ValueSpan GetSpanForIndex (unsigned index) const
 
- Private Member Functions inherited from Urho3D::Detail::NetworkValueBase
bool IsInitialized () const
 
unsigned GetCapacity () const
 
NetworkFrame GetFirstFrame () const
 
NetworkFrame GetLastFrame () const
 
void Resize (unsigned capacity)
 
ea::optional< unsigned > FrameToIndex (NetworkFrame frame) const
 
unsigned FrameToIndexUnchecked (NetworkFrame frame) const
 
ea::optional< unsigned > AllocatedFrameToIndex (NetworkFrame frame) const
 
bool AllocateFrame (NetworkFrame frame)
 
bool HasFrame (NetworkFrame frame) const
 
ea::optional< NetworkFrameFindClosestAllocatedFrame (NetworkFrame frame, bool searchPast, bool searchFuture) const
 
NetworkFrame GetClosestAllocatedFrame (NetworkFrame frame) const
 
InterpolationBase GetValidFrameInterpolation (const NetworkTime &time) const
 

Private Attributes

unsigned size_ {}
 
ea::vector< T > values_
 

Detailed Description

template<class T, class Traits = NetworkValueTraits<T>>
class Urho3D::NetworkValueVector< T, Traits >

Similar to NetworkValue, except each frame contains an array of elements.

Member Function Documentation

◆ SampleValid()

template<class T , class Traits = NetworkValueTraits<T>>
InterpolatedValueSpan Urho3D::NetworkValueVector< T, Traits >::SampleValid ( const NetworkTime time,
float  snapThreshold = M_LARGE_VALUE 
) const
inline

Server-side sampling: interpolate between consequent frames or return value of the closest valid frame.


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