Exemplo n.º 1
0
        public override bool MoveNext()
        {
            if (FiringStrategy.IsFiringEnd)
            {
                return(false);
            }

            Current = FiringStrategy.Current;

            if (Current == null)
            {
                return(false);
            }

            _accumulator.UpdateCurrentPath(Current);

            if (FiringStrategy.Current.SubNodes.Count > 1)//acc update
            {
                _accumulator.RememberRoot();
            }

            var stewNode = FiringStrategy.StewNode();

            foreach (var subnode in stewNode.SubNodes)
            {
                FiringStrategy.Burn(subnode);
            }

            if (stewNode.SubNodes.Count > 1)//acc update
            {
                _accumulator.RepeatRoot(stewNode.SubNodes.Count);
            }

            if (Current.SubNodes.Count == 0)//acc update
            {
                _accumulator.NextPath();
            }

            return(true);
        }
Exemplo n.º 2
0
        public virtual bool MoveNext()
        {
            if (FiringStrategy.IsFiringEnd)
            {
                return(false);
            }

            Current = FiringStrategy.Current;

            if (Current == null)
            {
                return(false);
            }

            var stewNode = FiringStrategy.StewNode();

            foreach (var subnode in stewNode.SubNodes)
            {
                FiringStrategy.Burn(subnode);
            }

            return(true);
        }