public void ReplaceHenchman(Henchman newHenchman)
 {
     var oldMinion = Interlocked.Exchange(ref minion, newHenchman);
     if (oldMinion != null)
         previousHenchmen.Add(oldMinion.Name);
     (oldMinion as IDisposable)?.Dispose();
 }
Exemple #2
0
        public void ReplaceHenchman(Henchman newHenchman)
        {
            var oldMinion = Interlocked.Exchange(ref minion, newHenchman);

            if (oldMinion != null)
            {
                previousHenchmen.Add(oldMinion.Name);
            }
            (oldMinion as IDisposable)?.Dispose();
        }