Table of Contents

Class SimulationStateStore<TState>

Namespace
Coherence.Toolkit
Assembly
Coherence.Toolkit.dll
public class SimulationStateStore<TState>

Type Parameters

TState
Inheritance
SimulationStateStore<TState>

Constructors

SimulationStateStore()

public SimulationStateStore()

Properties

Count

public int Count { get; }

Property Value

int

NewestFrame

public long NewestFrame { get; }

Property Value

long

OldestFrame

public long OldestFrame { get; }

Property Value

long

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 TState
simulationFrame 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 long

Last mispredicted frame.

validState TState

Last known valid state.

Returns

bool

False if there is no state in the store or the misprediction frame falls outside the store range.