Beispiel #1
0
 private void FillStrategyChain(StrategyChain chain, int index)
 {
     lock (lockObject)
     {
         if (innerChain != null)
         {
             innerChain.FillStrategyChain(chain, index);
         }
         chain.AddRange(stages[index]);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Makes a strategy chain based on this instance.
        /// </summary>
        /// <returns>A new <see cref="StrategyChain"/>.</returns>
        public IStrategyChain MakeStrategyChain()
        {
            lock (lockObject)
            {
                StrategyChain result = new StrategyChain();

                for (int index = 0; index < stages.Length; ++index)
                {
                    FillStrategyChain(result, index);
                }

                return(result);
            }
        }