Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        // 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();
            }
        }
Beispiel #3
0
        /// <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.
        }
Beispiel #4
0
 public QuestBehaviour CreateBehaviour(GameNPC npc, int maxExecutions)
 {
     QuestBehaviour questPart = new QuestBehaviour(questType, npc,maxExecutions);
     return questPart;
 }
Beispiel #5
0
 public QuestBehaviour CreateBehaviour(GameNPC npc)
 {
     QuestBehaviour questPart =  new QuestBehaviour(questType, npc);
     return questPart;
 }
Beispiel #6
0
 public void AddBehaviour(QuestBehaviour questPart)
 {
     addActionMethod.Invoke(null, new object[] { questPart });
 }
Beispiel #7
0
        // 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();
            }
        }
Beispiel #8
0
        /// <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);
        }
Beispiel #9
0
        /// <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 });
 }