Ejemplo n.º 1
0
        private static IScriptCommand BuildComplexCommand(string CommandName, params object[] args)
        {
            switch (CommandName)
            {
            case "loop":
                LoopStartCommand      start    = (LoopStartCommand)args[0];
                List <IScriptCommand> commands = (List <IScriptCommand>)args[1];
                LoopEndCommand        end      = (LoopEndCommand)args[2];
                return(new LoopCommand(start, commands, end));

            case "script":
                List <IScriptCommand> scriptsCommands = (List <IScriptCommand>)args[0];
                return(new CompositeCommand(scriptsCommands));

            case "composite":
                List <IScriptCommand> compositeCommands = (List <IScriptCommand>)args[0];
                return(new CompositeCommand(compositeCommands));
            }
            return(null);
        }
Ejemplo n.º 2
0
 public void VisitLoopEnd(LoopEndCommand End)
 {
     System.Console.WriteLine("loop-end");
 }
Ejemplo n.º 3
0
 public LoopCommand(LoopStartCommand start, List <IScriptCommand> commands, LoopEndCommand end) : base(commands)
 {
     Start = start;
     End   = end;
 }
 private void SerializeIf(LoopEndCommand cmd)
 {
     sb.AppendLine("loop_end_if");
 }