Esempio n. 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
            PlaceItem action = new PlaceItem(parentQuest);

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

            // Set custom marker
            Group markerGroup = match.Groups["marker"];

            if (markerGroup.Success)
            {
                action.marker = Parser.ParseInt(markerGroup.Value);
            }

            // Set custom quest marker
            Group markerPreferenceGroup = match.Groups["questmarker"];

            if (markerPreferenceGroup.Success)
            {
                action.marker           = Parser.ParseInt(markerPreferenceGroup.Value);
                action.markerPreference = MarkerPreference.UseQuestMarker;
            }

            return(action);
        }
Esempio n. 2
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
            PlaceItem action = new PlaceItem(parentQuest);

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

            return(action);
        }