Пример #1
0
 /// <summary>
 /// Registers a composite gate.  When all the gates have decremented to 0, the composite gate action is performed.
 /// When any gate reaches 0, its specific action is performed first.
 /// </summary>
 public void RegisterCompositeGate(string key, Action nextStep)
 {
     compositeGates[key] = new CompositeGate()
     {
         NextStep = nextStep
     };
 }
Пример #2
0
        /// <summary>
        /// Decrements the specified gate.  When all gates have decremented to 0, the composite action is also executed.
        /// </summary>
        public void DecrementCompositeGate(string key, string gateKey)
        {
            CompositeGate cg = compositeGates[key];

            cg.Gates[gateKey].Decrement();

            if (cg.Gates.Values.All(g => g.Count == 0))
            {
                cg.NextStep();
            }
        }
Пример #3
0
		/// <summary>
		/// Registers a composite gate.  When all the gates have decremented to 0, the composite gate action is performed.
		/// When any gate reaches 0, its specific action is performed first.
		/// </summary>
		public void RegisterCompositeGate(string key, Action nextStep)
		{
			compositeGates[key] = new CompositeGate() { NextStep = nextStep };
		}