Photon Fusion 2.0.3

Public Member Functions | Properties | List of all members
SimulationInput.Buffer Class Reference

Buffer for SimulationInputs. More...

Public Member Functions

bool Add (SimulationInput input, double? insertTime=null)
 Adds an input to the buffer. More...
 
 Buffer (NetworkProjectConfig cfg)
 Creates a new Buffer. More...
 
void Clear ()
 Clears the buffer. More...
 
bool Contains (Tick tick)
 Whether the buffer contains an input for tick . More...
 
int CopySortedTo (SimulationInput[] array)
 Copies the buffer to an array and sorts it. More...
 
SimulationInput Get (Tick tick)
 Gets the input for tick . More...
 
double? GetInsertTime (Tick tick)
 Gets the insert time for tick . More...
 
SimulationInputHeader GetLastUsedInputHeader ()
 Retrieves the last used input header data. More...
 
bool Remove (Tick tick, out SimulationInput removed)
 Removes an input for tick from the buffer. More...
 

Properties

int Count [get]
 Number of inputs in the buffer. More...
 
bool Full [get]
 Whether the buffer is full. More...
 

Detailed Description

Buffer for SimulationInputs.

Constructor & Destructor Documentation

◆ Buffer()

Creates a new Buffer.

Parameters
cfgNetwork project configuration.

Member Function Documentation

◆ Add()

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

Adds an input to the buffer.

Parameters
inputInput to add.
insertTimeInsert time for input .
Returns
Whether the input was added.

◆ Clear()

void Clear ( )

Clears the buffer.

◆ Contains()

bool Contains ( Tick  tick)

Whether the buffer contains an input for tick .

Parameters
tickTick to check.
Returns
Whether the buffer contains an input for tick .

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

Gets the input for tick .

Parameters
tickTick to get input for.
Returns
Input for tick .

◆ GetInsertTime()

double? GetInsertTime ( Tick  tick)

Gets the insert time for tick .

Parameters
tickTick to get insert time for.
Returns
Insert time for tick .

◆ GetLastUsedInputHeader()

SimulationInputHeader GetLastUsedInputHeader ( )

Retrieves the last used input header data.

Returns
The last used input header data.

◆ Remove()

bool Remove ( Tick  tick,
out SimulationInput  removed 
)

Removes an input for tick from the buffer.

Parameters
tickTick to remove.
removedRemoved input.
Returns
Whether an input was removed.

Property Documentation

◆ Count

int Count
get

Number of inputs in the buffer.

◆ Full

bool Full
get

Whether the buffer is full.