Exemple #1
0
        /// <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;
 }
Exemple #3
0
 private void Reset()
 {
     Tick     = Tick.INVALID;
     EntityId = EntityId.INVALID;
     RailPool.SafeReplace(ref state, null);
     IsFrozen = false;
 }
Exemple #4
0
        /// <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;
        }
Exemple #5
0
 private void Reset()
 {
     tick = Tick.INVALID;
     RailPool.SafeReplace(ref state, null);
 }