コード例 #1
0
        public object Visit_DialogueChoiceExpression(DialogueChoiceExpression choiceMember)
        {
            string name = choiceMember.Next.Accept(this) as string;

            if (name != null)
            {
                if (!currentTable.LookUp(name, out ISymbol symbol))
                {
                    throw RaiseError(ScriptErrorCode.ID_NOT_FOUND, ((NodeBase)choiceMember.Next).Token);
                }
            }

            return(0);
        }
コード例 #2
0
        public object Visit_DialogueChoiceExpression(DialogueChoiceExpression choiceMember)
        {
            if ((bool)choiceMember.Condition.Accept(this))
            {
                DialogueData   dialogue = Current["BlockData"] as DialogueData;
                DialogueChoice choice   = new DialogueChoice();

                string text = (string)choiceMember.Text.Accept(this);
                string next = (string)choiceMember.Next.Accept(this);

                choice.SetOption(text, next);

                dialogue.AddChoice(choice);
            }

            return(0);
        }