public EventCommandGotoLabel( GoToLabelCommand refCommand, FrmEvent editor )
 {
     InitializeComponent();
     mMyCommand = refCommand;
     mEventEditor = editor;
     InitLocalization();
     txtGotoLabel.Text = mMyCommand.Label;
 }
Ejemplo n.º 2
0
 private static string GetCommandText(GoToLabelCommand command, MapInstance map)
 {
     return(Strings.EventCommandList.gotolabel.ToString(command.Label));
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            using (reader = File.OpenText("input.txt"))
                using (writer = new StreamWriter(File.Create("output.txt")))
                {
                    QuackVM  vm = new QuackVM();
                    Workflow wf = new Workflow(vm);

                    while (!reader.EndOfStream)
                    {
                        string   str = reader.ReadLine();
                        ICommand cmd = null;
                        switch (str[0])
                        {
                        case '+':
                            cmd = new PlusCommand();
                            break;

                        case '-':
                            cmd = new MinusCommand();
                            break;

                        case '*':
                            cmd = new MultiplyCommand();
                            break;

                        case '/':
                            cmd = new DivideCommand();
                            break;

                        case '%':
                            cmd = new ModuloCommand();
                            break;

                        case '>':
                            cmd = new SetRegisterCommand(str[1]);
                            break;

                        case '<':
                            cmd = new GetRegisterCommand(str[1]);
                            break;

                        case 'P':
                            if (str.Length > 1)
                            {
                                cmd = new PrintRegisterCommand(str[1]);
                            }
                            else
                            {
                                cmd = new PrintCommand();
                            }
                            break;

                        case 'C':
                            if (str.Length > 1)
                            {
                                cmd = new PrintRegisterCharCommand(str[1]);
                            }
                            else
                            {
                                cmd = new PrintCharCommand();
                            }
                            break;

                        case ':':
                            cmd = new LabelCommand(str.Substring(1));
                            break;

                        case 'J':
                            cmd = new GoToLabelCommand(str.Substring(1));
                            break;

                        case 'Z':
                            cmd = new GoToLabelZCommand(str[1], str.Substring(2));
                            break;

                        case 'E':
                            cmd = new GoToLabelECommand(str[1], str[2], str.Substring(3));
                            break;

                        case 'G':
                            cmd = new GoToLabelGCommand(str[1], str[2], str.Substring(3));
                            break;

                        case 'Q':
                            cmd = new QuitCommand();
                            break;

                        default:
                            cmd = new NumberCommand(int.Parse(str));
                            break;
                        }
                        wf.AddCommand(cmd);
                    }

                    while (!wf.IsCompleted())
                    {
                        wf.ExecuteCurrentCommand();
                    }
                }
        }