public Barbershop() { for (int i = 0; i < chairsCount; i++) { chairs[i] = new Chair(); } }
private void Chill() { if (!barbershop.IsAlreadySeat(this)) { lock (barbershop.FindChairLocker) { Chair = barbershop.FindFreeChair(false); var tookFreeChair = Chair?.TrySeat(this) ?? false; if (tookFreeChair) { Logger.Write($"{Name} занял свободное кресло и отдыхает"); } } } Thread.Sleep(50); }