public void Work(int steps, Random rand) { if (TillsList == null || HumansQueue == null || TillsList.Count == 0 || steps <= 0) { Console.WriteLine("Магазин не работает"); return; } var indexOfLastTill = 0; foreach (var item in HumansQueue) { indexOfLastTill = TillsList.AddHuman(item, rand); } for (var i = 0; i < steps; i++) { TillsList.Work(); var human = CreateNewHuman(rand); indexOfLastTill = TillsList.AddHuman(human, rand); } TillsList.Display(indexOfLastTill); }
public Shop(TillsList tillsList, HumansQueue humansQueue) { if (tillsList != null && humansQueue != null) { TillsList = tillsList; HumansQueue = humansQueue; } }