Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Quantum.StreamReplayInputProvider Class Reference

The stream replay input provider is used to play back input from a stream. More...

Inheritance diagram for Quantum.StreamReplayInputProvider:
Photon.Deterministic.IDeterministicStreamReplayInputProvider Photon.Deterministic.IDeterministicReplayProvider Photon.Deterministic.IDeterministicRpcProvider Photon.Deterministic.IDeterministicInputProvider

Public Member Functions

 StreamReplayInputProvider (Stream inputStream, int maxFrame)
 Create a stream replay input provider. More...
 
void AddRpc (int player, byte[] data, bool command)
 Unused. More...
 
int BeginReadFrame (int frame)
 Request input for a certain frame. More...
 
bool CanSimulate (int frame)
 Is all input for this frame available. More...
 
void CompleteReadFrame (int frame, int length, ref byte[] data)
 Read the input data for the frame. More...
 
DeterministicFrameInputTemp GetInput (int frame, int player)
 Unused. More...
 
QTuple< byte[], bool > GetRpc (int frame, int player)
 Unused. More...
 
void Reset ()
 Resets the input provider when restarting a replay for example. The stream should be reset to the beginning. More...
 

Static Public Member Functions

static void ForwardToFrame (Stream stream, int frame)
 Skip to a selected frame in the stream. More...
 

Public Attributes

int MaxFrame => _maxFrame
 The max frame that the stream has input for. More...
 

Additional Inherited Members

- Properties inherited from Photon.Deterministic.IDeterministicStreamReplayInputProvider
int MaxFrame [get]
 The maximum frame number that the input provider can provide at a given moment. More...
 

Detailed Description

The stream replay input provider is used to play back input from a stream.

Constructor & Destructor Documentation

◆ StreamReplayInputProvider()

Quantum.StreamReplayInputProvider.StreamReplayInputProvider ( Stream  inputStream,
int  maxFrame 
)
inline

Create a stream replay input provider.

Parameters
inputStreamStream to read from
maxFrameMax frame that input is available for

Member Function Documentation

◆ Reset()

void Quantum.StreamReplayInputProvider.Reset ( )
inline

Resets the input provider when restarting a replay for example. The stream should be reset to the beginning.

Implements Photon.Deterministic.IDeterministicStreamReplayInputProvider.

◆ CanSimulate()

bool Quantum.StreamReplayInputProvider.CanSimulate ( int  frame)
inline

Is all input for this frame available.

Parameters
frameFrame number
Returns
True if all input is available and the simulation can progress

Implements Photon.Deterministic.IDeterministicInputProvider.

◆ BeginReadFrame()

int Quantum.StreamReplayInputProvider.BeginReadFrame ( int  frame)
inline

Request input for a certain frame.

Parameters
frameThe frame for the requested input
Returns
The size of the input to be read

Implements Photon.Deterministic.IDeterministicStreamReplayInputProvider.

◆ CompleteReadFrame()

void Quantum.StreamReplayInputProvider.CompleteReadFrame ( int  frame,
int  length,
ref byte[]  data 
)
inline

Read the input data for the frame.

Parameters
frameThe frame to read the input for
lengthThe input length requested in BeginReadFrame(int)
dataThe array to copy input data to

Implements Photon.Deterministic.IDeterministicStreamReplayInputProvider.

◆ GetInput()

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

◆ AddRpc()

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

◆ GetRpc()

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

◆ ForwardToFrame()

static void Quantum.StreamReplayInputProvider.ForwardToFrame ( Stream  stream,
int  frame 
)
inlinestatic

Skip to a selected frame in the stream.

Parameters
streamStream
frameFrame to fast forward to

Member Data Documentation

◆ MaxFrame

int Quantum.StreamReplayInputProvider.MaxFrame => _maxFrame

The max frame that the stream has input for.