Exemple #1
0
        public override IQuestAction CreateNew(string source, Quest parentQuest)
        {
            // Source must match pattern
            Match match = Test(source);

            if (!match.Success)
            {
                return(null);
            }

            // Factory new action
            ClickedItem action = new ClickedItem(parentQuest);

            action.itemSymbol = new Symbol(match.Groups["anItem"].Value);
            action.id         = Parser.ParseInt(match.Groups["id"].Value);

            // Resolve static message back to ID
            string idName = match.Groups["idName"].Value;

            if (action.id == 0 && !string.IsNullOrEmpty(idName))
            {
                Table table = QuestMachine.Instance.StaticMessagesTable;
                action.id = Parser.ParseInt(table.GetValue("id", idName));
            }

            return(action);
        }
        public override IQuestAction CreateNew(string source, Quest parentQuest)
        {
            // Source must match pattern
            Match match = Test(source);

            if (!match.Success)
            {
                return(null);
            }

            // Factory new action
            ClickedItem action = new ClickedItem(parentQuest);

            action.itemSymbol = new Symbol(match.Groups["anItem"].Value);

            return(action);
        }