예제 #1
0
 /// <summary>Called if is fired.</summary>
 /// <param name="triggerStateType">State of the trigger.</param>
 protected override void CalledOnFire(TriggerStateType triggerStateType)
 {
     if (this.onFire != null)
     {
         this.onFire(triggerStateType);
     }
 }
예제 #2
0
 /// <summary>Called if is fired.</summary>
 /// <param name="triggerStateType">State of the trigger.</param>
 protected override void CalledOnFire(TriggerStateType triggerStateType)
 {
     if (this.onFire != null)
     {
         this.onFire(triggerStateType);
     }
 }
예제 #3
0
파일: Trigger.cs 프로젝트: deccer/Xacor
        internal void Fire(TriggerStateType triggerStateType)
        {
            IsFired          = true;
            TriggerStateType = triggerStateType;
            if (CheckConditionToFire())
            {
                CalledOnFire(triggerStateType);
                OnFire?.Invoke(this);
            }

            IsFired = false;
        }
예제 #4
0
        /// <summary>Fires the specified trigger state.</summary>
        /// <param name="triggerStateType">State of the trigger.</param>
        internal void Fire(TriggerStateType triggerStateType)
        {
            this.IsFired          = true;
            this.TriggerStateType = triggerStateType;
            if (this.CheckConditionToFire())
            {
                this.CalledOnFire(triggerStateType);
                if (this.OnFire != null)
                {
                    this.OnFire(this);
                }
            }

            this.IsFired = false;
        }
예제 #5
0
        /// <summary>Sets the entry.</summary>
        /// <typeparam name="T">The <see langword="Type"/> T.</typeparam>
        /// <param name="name">The name.</param>
        /// <param name="intel">The intel.</param>
        public void SetEntry <T>(string name, T intel)
        {
            lock (this.entryLock)
            {
                TriggerStateType triggerStateType = this.intelligence.ContainsKey(name) ? TriggerStateType.ValueChanged : TriggerStateType.ValueAdded;
                this.intelligence[name] = intel;

                if (this.triggers.ContainsKey(name))
                {
                    foreach (Trigger item in this.triggers[name].Where(item => item.IsFired == false))
                    {
                        item.Fire(triggerStateType);
                    }
                }
            }
        }
예제 #6
0
        /// <summary>Fires the specified trigger state.</summary>
        /// <param name="triggerStateType">State of the trigger.</param>
        internal void Fire(TriggerStateType triggerStateType)
        {
            this.IsFired = true;
            this.TriggerStateType = triggerStateType;
            if (this.CheckConditionToFire())
            {
                this.CalledOnFire(triggerStateType);
                if (this.OnFire != null)
                {
                    this.OnFire(this);
                }
            }

            this.IsFired = false;
        }
예제 #7
0
 /// <summary>Called if is fired.</summary>
 /// <param name="triggerStateType">State of the trigger.</param>
 protected virtual void CalledOnFire(TriggerStateType triggerStateType)
 {
 }
예제 #8
0
 /// <summary>Called if is fired.</summary>
 /// <param name="triggerStateType">State of the trigger.</param>
 protected virtual void CalledOnFire(TriggerStateType triggerStateType)
 {
 }
예제 #9
0
 protected override void CalledOnFire(TriggerStateType triggerStateType)
 {
     _onFire?.Invoke(triggerStateType);
 }