/// <summary>The method was already called in the stack.</summary>
        public void RecursiveCall(ICallInfo callInfo, ActionSet callerSet)
        {
            // Push object array.
            if (_builder.Controller.Attributes.RecursiveRequiresObjectStack)
            {
                actionSet.AddAction(_objectStore.ModifyVariable(Operation.AppendToArray, (Element)callerSet.CurrentObject));
            }

            // Push new parameters.
            _builder.ParameterHandler.Push(callerSet, callInfo.Parameters.Select(p => p.Value).ToArray());

            // Add to the continue skip array.
            var skipLength = new NumberElement();

            actionSet.AddAction(_continueArray.ModifyVariable(
                                    Operation.AppendToArray,
                                    skipLength
                                    ));

            // Restart the method.
            SkipStartMarker resetSkip = new SkipStartMarker(actionSet);

            resetSkip.SetEndMarker(_endOfMethod);
            actionSet.AddAction(resetSkip);

            SkipEndMarker continueAtMarker = new SkipEndMarker();

            actionSet.AddAction(continueAtMarker);
            skipLength.Value = _continueAt.NumberOfActionsToMarker(continueAtMarker);
        }
Exemplo n.º 2
0
        protected override void GetResult()
        {
            SkipEndMarker endLoop = new SkipEndMarker();

            actionSet.AddAction(endLoop);
            PlayerNodeReachedBreak.SetEndMarker(endLoop);

            resolveInfo.Pathfind(actionSet, player, pathmapObject, parentArray.Get(), parentAttributeInfo.Get(), Source);
        }
        public override void Finished()
        {
            SkipEndMarker endLoop = new SkipEndMarker();

            ActionSet.AddAction(endLoop);
            _playerNodeReachedBreak.SetEndMarker(endLoop);

            ResolveInfo.Pathfind(ActionSet, _player, PathmapObject, Builder.ParentArray.Get(), _destination);
        }