示例#1
0
        private void Process(GotoCommand command)
        {
            if (command.area != GotoCommand.Areas.Game)
            {
                solver = null;
            }

            if (command.area == GotoCommand.Areas.Stasis)
            {
                Output.Post(new PlayerInput(BotId, new PlayerNameInput(Name)));
            }
        }
示例#2
0
    private void AddChoiceButtonListener(Button button, string label)
    {
        button.onClick.RemoveAllListeners();
        button.onClick.AddListener(() => {
            VsnCommand command           = new GotoCommand();
            List <VsnArgument> arguments = new List <VsnArgument>();
            arguments.Add(new VsnReference(label));

            VsnAudioManager.instance.PlaySfx("ui_confirm");

            command.InjectArguments(arguments);
            ShowChoicesPanel(false, 0);
            ShowDialogPanel(false);
            command.Execute();
            VsnController.instance.state = ExecutionState.PLAYING;
        });
    }
示例#3
0
        private void GoToParse()
        {
            if (Tokens.Count < 4)
            {
                return;
            }


            bool  isSuccess = false;
            Token t1        = Tokens.Pop();
            Token t2        = Tokens.Pop();
            Token t3        = Tokens.Pop();
            Token t4        = Tokens.Pop();

            if (t1.Type == TokenType.If &&
                t2.Type == TokenType.Register &&
                t3.Type == TokenType.Goto &&
                t4.Type == TokenType.Register)
            {
                if (Tokens.Peek().Type != TokenType.Semicolon)
                {
                    Error("No semicolon in operation", t4);
                }
                else
                {
                    Tokens.Pop();
                    byte          r1  = Convert.ToByte(t2.Value);
                    byte          r2  = Convert.ToByte(t4.Value);
                    BinaryCommand cmd = new GotoCommand(r1, r2);
                    Program.Add(cmd);
                    isSuccess = true;
                }
            }

            if (isSuccess)
            {
                return;
            }

            Tokens.Push(t4);
            Tokens.Push(t3);
            Tokens.Push(t2);
            Tokens.Push(t1);
        }
示例#4
0
 public void Goto(GotoCommand command)
 {
     _file.WriteLine($"// Goto argument {command.Arg1}");
     _file.WriteLine($"@{command.Arg1}");
     _file.WriteLine($"0;JMP");
 }
 public GotoTableDefinition TryAdd(CoreTransition transition, IDictionary <Core, int> coreToIndex) =>
 transition.Symbol is NonTerminal?this.Add(GotoCommand.Of(transition, coreToIndex)) : this;
 public GotoTableDefinition Add(GotoCommand command) =>
 new GotoTableDefinition(base.Content.Union(new[] { command }));