public override IQuestAction CreateNew(string source, Quest parentQuest) { // Source must match pattern Match match = Test(source); if (!match.Success) { return(null); } // Trim source end or trailing white space will be split to an empty symbol at end of array source = source.TrimEnd(); ClearTask action = new ClearTask(parentQuest); try { string[] tasks = source.Split(); action.taskSymbols = new Symbol[tasks.Length - 1]; for (int i = 0; i < action.taskSymbols.Length; i++) { action.taskSymbols[i] = new Symbol(tasks[i + 1]); } } catch (System.Exception ex) { DaggerfallUnity.LogMessage("ClearTask.CreateNew() failed with exception: " + ex.Message, true); action = null; } return(action); }
public override IQuestAction CreateNew(string source, Quest parentQuest) { base.CreateNew(source, parentQuest); // Source must match pattern Match match = Test(source); if (!match.Success) { return(null); } ClearTask action = new ClearTask(parentQuest); try { string[] tasks = source.Split(); action.taskSymbols = new Symbol[tasks.Length - 1]; for (int i = 0; i < action.taskSymbols.Length; i++) { action.taskSymbols[i] = new Symbol(tasks[i + 1]); } } catch (System.Exception ex) { DaggerfallUnity.LogMessage("ClearTask.Create() failed with exception: " + ex.Message, true); action = null; } return(action); }