Ejemplo n.º 1
0
        protected override IEnumerator LoopCoroutine(Flow flow)
        {
            var loop = Start(flow, out var enumerator, out var dictionaryEnumerator, out var currentIndex);

            var stack = flow.PreserveStack();

            try
            {
                while (flow.LoopIsNotBroken(loop) && MoveNext(flow, enumerator, dictionaryEnumerator, ref currentIndex))
                {
                    yield return(body);

                    flow.RestoreStack(stack);
                }
            }
            finally
            {
                (enumerator as IDisposable)?.Dispose();
            }

            flow.DisposePreservedStack(stack);

            flow.ExitLoop(loop);

            yield return(exit);
        }
Ejemplo n.º 2
0
        protected override IEnumerator LoopCoroutine(Flow flow)
        {
            var loop = Start(flow);

            var stack = flow.PreserveStack();

            while (flow.LoopIsNotBroken(loop) && CanMoveNext(flow))
            {
                yield return(body);

                flow.RestoreStack(stack);
            }

            flow.DisposePreservedStack(stack);

            flow.ExitLoop(loop);

            yield return(exit);
        }
Ejemplo n.º 3
0
        protected override ControlOutput Loop(Flow flow)
        {
            var loop = Start(flow);

            var stack = flow.PreserveStack();

            while (flow.LoopIsNotBroken(loop) && CanMoveNext(flow))
            {
                flow.Invoke(body);

                flow.RestoreStack(stack);
            }

            flow.DisposePreservedStack(stack);

            flow.ExitLoop(loop);

            return(exit);
        }
Ejemplo n.º 4
0
        protected override ControlOutput Loop(Flow flow)
        {
            var loop = Start(flow, out int currentIndex, out int lastIndex, out bool ascending);

            var stack = flow.PreserveStack();

            while (flow.LoopIsNotBroken(loop) && CanMoveNext(currentIndex, lastIndex, ascending))
            {
                flow.Invoke(body);

                flow.RestoreStack(stack);

                MoveNext(flow, ref currentIndex);
            }

            flow.DisposePreservedStack(stack);

            flow.ExitLoop(loop);

            return(exit);
        }
Ejemplo n.º 5
0
        protected override IEnumerator LoopCoroutine(Flow flow)
        {
            var loop = Start(flow, out int currentIndex, out int lastIndex, out bool ascending);

            var stack = flow.PreserveStack();

            while (flow.LoopIsNotBroken(loop) && CanMoveNext(currentIndex, lastIndex, ascending))
            {
                yield return(body);

                flow.RestoreStack(stack);

                MoveNext(flow, ref currentIndex);
            }

            flow.DisposePreservedStack(stack);

            flow.ExitLoop(loop);

            yield return(exit);
        }