/// <summary> /// Remove the given questpart from the quest and also unregister the handlers /// </summary> /// <param name="questPart">QuestPart to be removed</param> public static void RemoveBehaviour(QuestBehaviour questPart) { if (QuestParts == null) { return; } UnRegisterBehaviour(questPart); QuestParts.Remove(questPart); }
// Base QuestPart methods /// <summary> /// Remove all registered handlers for this quest, /// this will not remove the questPart from the quest. /// </summary> /// <param name="questPart">QuestPart to remove handlers from</param> protected static void UnRegisterBehaviour(QuestBehaviour questPart) { if (questPart.Triggers == null) { return; } foreach (IBehaviourTrigger trigger in questPart.Triggers) { trigger.Unregister(); } }
/// <summary> /// Adds the given questpart to the quest depending on the added triggers it will either /// be added as InteractQuestPart as NotifyQuestPart or both and also register the needed event handler. /// </summary> /// <param name="questPart">QuestPart to be added</param> public static void AddBehaviour(QuestBehaviour questPart) { if (QuestParts == null) { QuestParts = new ArrayList(); } if (!QuestParts.Contains(questPart)) { QuestParts.Add(questPart); } questPart.ID = QuestParts.Count; // fake id but ids only have to be unique quest wide its enough to use the number in the list as id. }
public QuestBehaviour CreateBehaviour(GameNPC npc, int maxExecutions) { QuestBehaviour questPart = new QuestBehaviour(questType, npc,maxExecutions); return questPart; }
public QuestBehaviour CreateBehaviour(GameNPC npc) { QuestBehaviour questPart = new QuestBehaviour(questType, npc); return questPart; }
public void AddBehaviour(QuestBehaviour questPart) { addActionMethod.Invoke(null, new object[] { questPart }); }
// Base QuestPart methods /// <summary> /// Remove all registered handlers for this quest, /// this will not remove the questPart from the quest. /// </summary> /// <param name="questPart">QuestPart to remove handlers from</param> protected static void UnRegisterBehaviour(QuestBehaviour questPart) { if (questPart.Triggers == null) return; foreach (IBehaviourTrigger trigger in questPart.Triggers) { trigger.Unregister(); } }
/// <summary> /// Remove the given questpart from the quest and also unregister the handlers /// </summary> /// <param name="questPart">QuestPart to be removed</param> public static void RemoveBehaviour(QuestBehaviour questPart) { if (questParts == null) return; UnRegisterBehaviour(questPart); questParts.Remove(questPart); }
/// <summary> /// Adds the given questpart to the quest depending on the added triggers it will either /// be added as InteractQuestPart as NotifyQuestPart or both and also register the needed event handler. /// </summary> /// <param name="questPart">QuestPart to be added</param> public static void AddBehaviour(QuestBehaviour questPart) { if (questParts == null) questParts = new ArrayList(); if (!questParts.Contains(questPart)) questParts.Add(questPart); questPart.ID = questParts.Count; // fake id but ids only have to be unique quest wide its enough to use the number in the list as id. }
public QuestBehaviour CreateBehaviour(GameNPC npc, int maxExecutions) { QuestBehaviour questPart = new QuestBehaviour(questType, npc, maxExecutions); return(questPart); }
public QuestBehaviour CreateBehaviour(GameNPC npc) { QuestBehaviour questPart = new QuestBehaviour(questType, npc); return(questPart); }
public void AddBehaviour(QuestBehaviour questPart) { addActionMethod.Invoke(null, new object[] { questPart }); }