Photon Quantum 3.0.0

Public Member Functions | List of all members
Quantum.RingBufferInputProvider Class Reference

This input provider can store a certain amount of input sets in a ring buffer. More...

Inheritance diagram for Quantum.RingBufferInputProvider:
Photon.Deterministic.IDeterministicReplayProvider Photon.Deterministic.IDeterministicRpcProvider Photon.Deterministic.IDeterministicInputProvider

Public Member Functions

 RingBufferInputProvider (DeterministicSessionConfig sessionConfig, int capacity=256)
 Create a ring buffer input provider. More...
 
 RingBufferInputProvider (DeterministicTickInputSet[] inputList)
 Create a ring buffer input provider from a list of input sets. More...
 
 RingBufferInputProvider (int playerCount, int startFrame, int capacity)
 Create a ring buffer input provider. More...
 
void AddRpc (int player, byte[] data, bool command)
 Unused More...
 
bool CanSimulate (int frame)
 Returns true if for the given frame input is available. More...
 
void Clear (int startFrame)
 Clear all input sets. More...
 
DeterministicFrameInputTemp GetInput (int frame, int player)
 Read the input object. More...
 
QTuple< byte[], bool > GetRpc (int frame, int player)
 Read the rpc from the input. More...
 
void InjectInput (DeterministicTickInput input, bool localReplay)
 Inject input into the buffer. More...
 
void OnInputConfirmed (QuantumGame game, DeterministicFrameInputTemp input)
 The callback is used to record inputs. More...
 

Detailed Description

This input provider can store a certain amount of input sets in a ring buffer.

Constructor & Destructor Documentation

◆ RingBufferInputProvider() [1/3]

Quantum.RingBufferInputProvider.RingBufferInputProvider ( DeterministicSessionConfig  sessionConfig,
int  capacity = 256 
)
inline

Create a ring buffer input provider.

Parameters
sessionConfigSession config
capacityTotal capacity

◆ RingBufferInputProvider() [2/3]

Quantum.RingBufferInputProvider.RingBufferInputProvider ( DeterministicTickInputSet[]  inputList)
inline

Create a ring buffer input provider from a list of input sets.

Parameters
inputListInput sets

◆ RingBufferInputProvider() [3/3]

Quantum.RingBufferInputProvider.RingBufferInputProvider ( int  playerCount,
int  startFrame,
int  capacity 
)
inline

Create a ring buffer input provider.

Parameters
playerCountMax player count
startFrameStart frame
capacityRing buffer capacity

Member Function Documentation

◆ CanSimulate()

bool Quantum.RingBufferInputProvider.CanSimulate ( int  frame)
inline

Returns true if for the given frame input is available.

Parameters
frameRequested frame
Returns
True when there is input for the requested frame

Implements Photon.Deterministic.IDeterministicInputProvider.

◆ Clear()

void Quantum.RingBufferInputProvider.Clear ( int  startFrame)
inline

Clear all input sets.

Parameters
startFrameNew start frame

◆ OnInputConfirmed()

void Quantum.RingBufferInputProvider.OnInputConfirmed ( QuantumGame  game,
DeterministicFrameInputTemp  input 
)
inline

The callback is used to record inputs.

Parameters
gameQuantum game
inputThe confirmed input

◆ InjectInput()

void Quantum.RingBufferInputProvider.InjectInput ( DeterministicTickInput  input,
bool  localReplay 
)
inline

Inject input into the buffer.

Parameters
inputInput to inject
localReplayIf set to true the sent flag will be set

◆ AddRpc()

void Quantum.RingBufferInputProvider.AddRpc ( int  player,
byte[]  data,
bool  command 
)
inline

◆ GetRpc()

QTuple<byte[], bool> Quantum.RingBufferInputProvider.GetRpc ( int  frame,
int  player 
)
inline

Read the rpc from the input.

Parameters
frameFrame
playerPlayer
Returns
Rpc data

Implements Photon.Deterministic.IDeterministicRpcProvider.

◆ GetInput()

DeterministicFrameInputTemp Quantum.RingBufferInputProvider.GetInput ( int  frame,
int  player 
)
inline

Read the input object.

Parameters
frameFrame
playerPlayer
Returns
Input object

Implements Photon.Deterministic.IDeterministicInputProvider.