private void ProcessTime(UnrealBinaryHeapEx <Invoker> invokers) { // Note: If the the delay is low enough this may loop forever (the timer would need a repeat // value lower than the time it takes to get from the end of Process() back to the EndValue check // - If this becomes a problem you could stop this from happening by holding onto the last invoker // processed and checking invoker!=lastInvoker // - Though if this is a problem it will make the game crawl anyway due to CallCount. A frame will // occasionally get through between the invoker spam if doing the lastInvoker check. //Invoker lastInvoker = null; while (invokers.Count > 0) { Invoker invoker = invokers.HeapTop(); ulong value = (ulong)WorldTimeHelper.GetTimeChecked(invoker.OwnerWorld).Ticks; if (invoker.EndValue <= value /*&& invoker != lastInvoker*/) { invokers.HeapPopDiscard(); invoker.Process(value); //lastInvoker = invoker; } else { break; } } }
private void Process(UnrealBinaryHeapEx <Invoker> invokers, ulong value) { while (invokers.Count > 0) { Invoker invoker = invokers.HeapTop(); if (invoker.EndValue <= value) { invokers.HeapPopDiscard(); invoker.Process(value); } else { break; } } }
public void Process(CoroutineGroup group) { UnrealBinaryHeapEx <T> collection = GetCollection(group); while (collection.Count > 0) { T instruction = collection.HeapTop(); if (instruction.KeepWaiting) { return; } collection.HeapPopDiscard(); // Return the control over to the main coroutines collection instruction.comparableCollection = null; Coroutine.ComparableEnd(instruction.Owner); } }