Photon Fusion 2.1.1

SimulationInput.Buffer Class Reference

A buffer for instances of SimulationInput. More...

Public Member Functions

bool Add (SimulationInput input, double? timeInserted=null)
 Adds input to the buffer.
 Buffer (int capacity)
 Creates a new Buffer.
void Clear ()
 Removes all inputs from the buffer.
bool Contains (Tick tick)
 Returns true if the buffer has an input for the provided tick .
int CopySortedTo (SimulationInput[] array)
 Copies the buffer to an array and sorts it.
SimulationInput Get (Tick tick)
 Returns the input for the provided tick .
SimulationInputHeader GetLastUsedInputHeader ()
 Returns the most recently removed input header.
bool Remove (Tick tick, out SimulationInput removed)
 Returns true if the buffer had an input for the provided tick (and outputs the removed input).
bool Remove (Tick tick, out SimulationInput removed, out double? timeInserted)
 Returns true if the buffer had an input for the provided tick (and outputs the removed input and its insertion time).
bool TryGet (Tick tick, out SimulationInput input)
 Returns true if the buffer has an input for the provided tick (and outputs the input ).
bool TryGet (Tick tick, out SimulationInput input, out double? timeInserted)
 Returns true if the buffer has an input for the provided tick (and outputs the input and its insertion time).

Properties

int Capacity [get]
 The maximum number of inputs that the buffer can contain.
int Count [get]
 The number of inputs in the buffer.
bool IsFull [get]
 Returns true if the buffer contains the maximum number of inputs.

Detailed Description

A buffer for instances of SimulationInput.

Constructor & Destructor Documentation

◆ Buffer()

Buffer ( int capacity)

Creates a new Buffer.

Parameters
capacityThe maximum number of inputs that the buffer can contain.

Member Function Documentation

◆ Add()

bool Add ( SimulationInput input,
double? timeInserted = null )

Adds input to the buffer.

Parameters
input
timeInserted
Returns

◆ Contains()

bool Contains ( Tick tick)

Returns true if the buffer has an input for the provided tick .

Parameters
tick
Returns

◆ CopySortedTo()

int CopySortedTo ( SimulationInput[] array)

Copies the buffer to an array and sorts it.

Parameters
arrayArray to copy to.
Returns
Number of elements copied.

◆ Get()

SimulationInput Get ( Tick tick)

Returns the input for the provided tick .

Parameters
tick
Returns

◆ GetLastUsedInputHeader()

SimulationInputHeader GetLastUsedInputHeader ( )

Returns the most recently removed input header.

Returns

◆ Remove() [1/2]

bool Remove ( Tick tick,
out SimulationInput removed )

Returns true if the buffer had an input for the provided tick (and outputs the removed input).

Parameters
tick
removed
Returns

◆ Remove() [2/2]

bool Remove ( Tick tick,
out SimulationInput removed,
out double? timeInserted )

Returns true if the buffer had an input for the provided tick (and outputs the removed input and its insertion time).

Parameters
tick
removed
timeInserted
Returns

◆ TryGet() [1/2]

bool TryGet ( Tick tick,
out SimulationInput input )

Returns true if the buffer has an input for the provided tick (and outputs the input ).

Parameters
tick
input
Returns

◆ TryGet() [2/2]

bool TryGet ( Tick tick,
out SimulationInput input,
out double? timeInserted )

Returns true if the buffer has an input for the provided tick (and outputs the input and its insertion time).

Parameters
tick
input
timeInserted
Returns