The instant replay feature. It can be used as is or used as a base class for custom instant replay implementations. More...
Inherits IDisposable.
Public Member Functions | |
QuantumInstantReplay (QuantumGame liveGame, float length, QuantumInstantReplaySeekMode seekMode=QuantumInstantReplaySeekMode.Disabled, bool loop=false) | |
Create and start an instant replay. More... | |
void | Dispose () |
Stop and dispose the instant replay by clearing cached snapshots and shutting down the replay runner. More... | |
void | SeekFrame (int frameNumber) |
Seek to a desired frame number during the running instant replay. More... | |
void | SeekNormalizedTime (float normalizedTime) |
Seek the replay by inputting a normalized time [0..1]. More... | |
bool | Update (float deltaTime) |
Updates the instant replay session. Will loop the replay if enabled. More... | |
Public Attributes | |
bool | CanSeek => _rewindSnapshots?.Count > 0 |
Returns true if the instant replay can seek to a desired frame. More... | |
int | CurrentFrame => _replayRunner.Game.Frames.Verified.Number |
Returns current frame number of the replay. More... | |
bool | IsRunning => CurrentFrame < EndFrame |
Returns true is the instant replay is running. More... | |
QuantumGame | ReplayGame => _replayRunner?.Game |
Returns the replay Quantum Game or null. More... | |
Static Public Attributes | |
const int | InitialFramesToSimulation = 4 |
We need this to fast forward the simulation and wait until is fully initialized. More... | |
Properties | |
int | EndFrame [get] |
Returns the last frame number of the replay which is usually the end frame of the original game when the instant replay was started. More... | |
QuantumGame | LiveGame [get] |
Returns the live Quantum Game. More... | |
float | NormalizedTime [get] |
Returns the progress or normalized time [0..1] of the instant replay. More... | |
int | StartFrame [get] |
Returns the frame number the instant replay started from. More... | |
The instant replay feature. It can be used as is or used as a base class for custom instant replay implementations.
|
inline |
Create and start an instant replay.
liveGame | The original game. |
length | The time in seconds to rewind the original game and start the instant replay from. |
seekMode | An optional seek mode to seek and rewind the running instant replay. |
loop | Automatically loop the instant replay and never stop. |
ArgumentNullException | Is raised when the live game is null. |
ArgumentException | Is raised when no valid snapshot was found to start the replay from. |
|
inline |
Stop and dispose the instant replay by clearing cached snapshots and shutting down the replay runner.
|
inline |
Seek to a desired frame number during the running instant replay.
frameNumber | Desired frame number. |
InvalidOperationException | Is raised when the replay is not seek-able. |
ArgumentOutOfRangeException | Is raised when the desired frame could not be reached by the cached snapshots. |
|
inline |
Seek the replay by inputting a normalized time [0..1].
normalizedTime | Replay progress between 0 and 1. |
|
inline |
Updates the instant replay session. Will loop the replay if enabled.
deltaTime | Passed delta time in seconds. |
|
static |
We need this to fast forward the simulation and wait until is fully initialized.
int Quantum.QuantumInstantReplay.CurrentFrame => _replayRunner.Game.Frames.Verified.Number |
Returns current frame number of the replay.
bool Quantum.QuantumInstantReplay.CanSeek => _rewindSnapshots?.Count > 0 |
Returns true if the instant replay can seek to a desired frame.
bool Quantum.QuantumInstantReplay.IsRunning => CurrentFrame < EndFrame |
Returns true is the instant replay is running.
QuantumGame Quantum.QuantumInstantReplay.ReplayGame => _replayRunner?.Game |
Returns the replay Quantum Game or null.
|
get |
Returns the frame number the instant replay started from.
|
get |
Returns the last frame number of the replay which is usually the end frame of the original game when the instant replay was started.
|
get |
Returns the live Quantum Game.
|
get |
Returns the progress or normalized time [0..1] of the instant replay.