Class SimulationStateStore<TState>
public class SimulationStateStore<TState>
Type Parameters
TState
- Inheritance
-
SimulationStateStore<TState>
Constructors
SimulationStateStore()
public SimulationStateStore()
Properties
Count
public int Count { get; }
Property Value
NewestFrame
public long NewestFrame { get; }
Property Value
OldestFrame
public long OldestFrame { get; }
Property Value
Methods
Acknowledge(long)
Removes all states up to a given frame.
public void Acknowledge(long frame)
Parameters
frame
long
Add(in TState, long)
Stores the latest known state. The frame of the state must be subsequent to the previous state frame.
public void Add(in TState state, long simulationFrame)
Parameters
state
TStatesimulationFrame
long
Clear()
Removes all stored states and resets NewestFrame and OldestFrame.
public void Clear()
GetEnumerator()
public IEnumerator<TState> GetEnumerator()
Returns
- IEnumerator<TState>
TryRollback(long, out TState)
Attempts to roll back the state store returning the latest valid state.
public bool TryRollback(long mispredictionFrame, out TState validState)
Parameters
mispredictionFrame
longLast mispredicted frame.
validState
TStateLast known valid state.
Returns
- bool
False if there is no state in the store or the misprediction frame falls outside the store range.