Esempio n. 1
0
        private void UpdateValues(bool setStartValue)
        {
            if (!Running)
            {
                return;
            }

            if (setStartValue)
            {
                switch (Type)
                {
                case InvokerType.Delay:
                    BeginValue = startingValue = (ulong)WorldTimeHelper.GetTimeChecked(OwnerWorld).Ticks;
                    break;

                case InvokerType.Ticks:
                    BeginValue = startingValue = EngineLoop.WorldTickCounter;
                    break;

                case InvokerType.Frames:
                    BeginValue = startingValue = EngineLoop.WorldFrameNumber;
                    break;
                }
            }

            InvokerCollectionGroup       newCollectionGroup = GetInvokerGroup(Group);
            UnrealBinaryHeapEx <Invoker> newCollection      = newCollectionGroup == null ? null : newCollectionGroup.GetCollection(Type);

            if (collectionGroup != null && collection != null)
            {
                if (collectionGroup.Group != Group || newCollection != collection)
                {
                    collection.HeapRemove(this);
                    collection      = null;
                    collectionGroup = null;
                }
            }

            if (newCollection != null)
            {
                collectionGroup = newCollectionGroup;
                collection      = newCollection;
                newCollection.HeapPush(this);
            }
        }