Ejemplo n.º 1
0
        public void CancelEvent(HistoryEvent historyEvent)
        {
            if (historyEvent.storeInHistory == false)
            {
                return;
            }

            if (historyEvent.tick <= Tick.Zero)
            {
                // Tick fix if it is zero
                historyEvent.tick = Tick.One;
            }

            ME.ECS.Collections.SortedList <long, HistoryEvent> list;
            if (this.events.TryGetValue(historyEvent.tick, out list) == true)
            {
                var key = MathUtils.GetKey(historyEvent.order, historyEvent.localOrder);
                if (list.Remove(key) == true)
                {
                    --this.statEventsAdded;
                    this.oldestTick = (this.oldestTick == Tick.Invalid || historyEvent.tick < this.oldestTick ? (Tick)historyEvent.tick : this.oldestTick);
                }
            }
        }