Photon Fusion 2.1.1

NetworkTransformTrace.BufferedData< T > Class Template Reference

A circular buffer holding data of type {T}. More...

Public Member Functions

int GetSamplesInOrder (T[] output)
 Copies values out of the circular buffer into the target array the samples are copied in order.
bool TryGetSample (int sampleIndex, out T value)
 Attempts to read a specific sample index. Returns false if the sample is too old (overwritten) or hasn't been written yet.

Properties

bool HasData [get]
 If the buffer has had any data writtetn to it.
Recent [get]
 Most recent value written, or default(T) if HasData == false.

Detailed Description

A circular buffer holding data of type {T}.

Template Parameters
TThe type of data to be stored in the buffer
Type Constraints
T :struct 

Member Function Documentation

◆ GetSamplesInOrder()

int GetSamplesInOrder ( T[] output)

Copies values out of the circular buffer into the target array the samples are copied in order.

Parameters
outputshould be sized to BufferSize to fit a full buffer
Returns
the number of samples written