/// <summary>
        /// Adds a trigger to the questpart for details about parameters look at documentation of used triggertype
        /// </summary>
        /// <param name="trigger"></param>
        public void AddTrigger(IBehaviourTrigger trigger)
        {
            if (triggers == null)
            {
                triggers = new List <IBehaviourTrigger>();
            }

            triggers.Add(trigger);
            trigger.Register();
        }
        /// <summary>
        /// Adds a trigger to the questpart for details about parameters look at documentation of used triggertype
        /// </summary>
        /// <param name="triggerType">triggertype</param>
        /// <param name="keyword">keyword (K), meaning depends on triggertype</param>
        /// <param name="var">variable (I), meaning depends on triggertype</param>
        public void AddTrigger(eTriggerType triggerType, Object keyword, Object var)
        {
            IBehaviourTrigger trigger = null;

            Type type = BehaviourMgr.GetTypeForTriggerType(triggerType);

            if (type != null)
            {
                trigger = (IBehaviourTrigger)Activator.CreateInstance(type, new object[] { this.NPC, NotifyHandler, keyword, var });
                AddTrigger(trigger);
            }
            else
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("No registered trigger found for TriggerType " + triggerType);
                }
            }
        }
示例#3
0
 /// <summary>
 /// Adds a trigger to the questpart for details about parameters look at documentation of used triggertype
 /// </summary>
 /// <param name="trigger"></param>
 public void AddTrigger(IBehaviourTrigger trigger)
 {
     if (triggers == null)
         triggers = new List<IBehaviourTrigger>();
     
     triggers.Add(trigger);            
     trigger.Register();
 }