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