void JumpToTarget()
 {
     callStack.ClearIfStack();
     target = ArgumentExpression.replaceVariable(target, context.VariableRepository);
     index  = context.ScenarioRepository.GetCurrentRunningScenario().getIndex(target);
     callStack.JumpToCommand(index);
 }
Esempio n. 2
0
        public void Execute(ICallStack callStack, IStoryContext context)
        {
            bool result         = bool.Parse(ArgumentExpression.Calculate(MainExp));
            bool optionalResult = true;

            if (!string.IsNullOrEmpty(OptionalExp))
            {
                optionalResult = bool.Parse(ArgumentExpression.Calculate(OptionalExp));
            }

            bool resultingIf = callStack.ResultingIf;

            callStack.AddIfStack(result);
            if (!result && resultingIf && optionalResult)
            {
                nextIndex = callStack.CurrentCommandIndex + 1;
            }
            else
            {
                var currentScenario = context.ScenarioRepository.GetCurrentRunningScenario();
                for (int i = callStack.CurrentCommandIndex + 1; i < currentScenario.Commands.Count; i++)
                {
                    if (typeof(ILogicControlCommand).IsAssignableFrom(currentScenario.Commands[i].GetType()))
                    {
                        nextIndex = i;
                        break;
                    }
                }
            }
        }
        public void Execute(ICallStack callStack, IStoryContext context)
        {
            ArgumentExpression eo = new ArgumentExpression(exp);

            string result = ArgumentExpression.Calculate(eo.exp);

            context.VariableRepository.SetString(eo.name, result);
        }
        public void Execute(ICallStack callStack, IStoryContext context)
        {
            string show_name = val;

            context.ActorPresenter.SetFocus(val);
            show_name = ArgumentExpression.replaceVariable(val, context.VariableRepository);
            //show_name = context.VariableRepository.GetString(val);
            context.MessagePresenter.SetTokenName(show_name);
        }
        public void Execute(ICallStack callStack, IStoryContext context)
        {
            callStack.ClearIfStack();
            if (string.IsNullOrEmpty(file))
            {
                file = context.ScenarioRepository.GetCurrentRunningScenario().name;
            }
            file = ArgumentExpression.replaceVariable(file, context.VariableRepository);

            context.ScenarioRepository.JumpToScenario(file);

            target = ArgumentExpression.replaceVariable(target, context.VariableRepository);

            if (index < 0)
            {
                index = context.ScenarioRepository.GetScenario(file).getIndex(target);
            }
        }
 public void Execute(ICallStack callStacks, IStoryContext context)
 {
     val = ArgumentExpression.replaceVariable(val, context.VariableRepository);
     context.MessagePresenter.RenderMessage(val);
 }