Пример #1
0
 public APExecutionTracker(GenCtxProperties <AsyncPattern> props, AsyncHandoff abh, out bool isClipped)
 {
     looper        = new LoopControl <AsyncPattern>(props, abh.ch, out isClipped);
     this.abh      = abh;
     parent_done   = abh.done;
     abh.done      = () => { };
     elapsedFrames = 0f;
     wasPaused     = false;
 }
Пример #2
0
 public SMExecutionTracker(GenCtxProperties <StateMachine> props, SMHandoff smh, out bool isClipped)
 {
     looper              = new LoopControl <StateMachine>(props, smh.ch, out isClipped);
     this.smh            = smh;
     this.smh.CanPrepend = true;
     waitChild           = props.waitChild;
     sequential          = props.sequential;
     checkIsChildDone    = null;
 }
Пример #3
0
 public IPExecutionTracker(GenCtxProperties <AsyncPattern> props, AsyncHandoff abh, out bool isClipped)
 {
     looper           = new LoopControl <AsyncPattern>(props, abh.ch, out isClipped);
     this.abh         = abh;
     parent_done      = abh.done;
     abh.done         = () => { };
     elapsedFrames    = 0f;
     waitChild        = props.waitChild;
     sequential       = props.sequential;
     checkIsChildDone = null;
     wasPaused        = false;
 }
Пример #4
0
        public static AsyncPattern GCRepeat(GenCtxProperties <AsyncPattern> props, SyncPattern[] target)
        {
            IEnumerator Inner(AsyncHandoff abh)
            {
                APExecutionTracker tracker = new APExecutionTracker(props, abh, out bool isClipped);

                if (isClipped)
                {
                    tracker.AllSDone(false);
                    yield break;
                }
                if (tracker.CleanupIfCancelled())
                {
                    yield break;
                }
                for (tracker.StartInitialDelay(); tracker.IsWaiting; tracker.WaitStep())
                {
                    yield return(null);

                    if (tracker.CleanupIfCancelled())
                    {
                        yield break;
                    }
                }
                while (tracker.RemainsExceptLast && tracker.PrepareIteration())
                {
                    tracker.DoSIteration(target);
                    for (tracker.StartWait(); tracker.IsWaiting; tracker.WaitStep())
                    {
                        yield return(null);

                        if (tracker.CleanupIfCancelled())
                        {
                            yield break;
                        }
                    }
                    tracker.FinishIteration();
                }
                if (tracker.PrepareLastIteration())
                {
                    tracker.DoSIteration(target);
                    tracker.FinishIteration();
                }
                tracker.AllSDone(true);
            }

            return(Inner);
        }
Пример #5
0
 public SPExecutionTracker(GenCtxProperties <SyncPattern> props, SyncHandoff sbh, out bool isClipped)
 {
     looper   = new LoopControl <SyncPattern>(props, sbh.ch, out isClipped);
     this.sbh = sbh;
 }