/// <summary> /// Stores a value. Will not replace a stored value with an older one. /// </summary> public bool Store(T value) { int index = TickToIndex(value.Tick); bool store = false; if (latestIdx < 0) { store = true; } else { T latest = data[latestIdx]; if (value.Tick >= latest.Tick) { store = true; } } if (store) { RailPool.SafeReplace(ref data[index], value); latestIdx = index; } return(store); }
private void Reset() { this.tick = Tick.INVALID; this.entityId = EntityId.INVALID; RailPool.SafeReplace(ref this.state, null); this.IsFrozen = false; }
private void Reset() { Tick = Tick.INVALID; EntityId = EntityId.INVALID; RailPool.SafeReplace(ref state, null); IsFrozen = false; }
/// <summary> /// Clears the buffer, freeing all contents. /// </summary> public void Clear() { for (int i = 0; i < data.Length; i++) { RailPool.SafeReplace(ref data[i], null); } latestIdx = -1; }
private void Reset() { tick = Tick.INVALID; RailPool.SafeReplace(ref state, null); }