public Patient(WaitingRoom wr) { this.wr = wr; wr.NumberChange += ReactToNumber; numberInQueue = wr.DrawNumber(); Console.WriteLine($"Patient {numberInQueue} enters waiting room"); Thread.Sleep(1000); }
/* * In the Main method of the Program class, * create an instance of the WaitingRoom and * call the RunWaitingRoom method. Currently it * won't do anything, because no patients * have drawn a number. */ static void Main(string[] args) { var wr = new WaitingRoom(); var jakob = new Patient(wr); var troels = new Patient(wr); var kasper = new Patient(wr); wr.RunWaitingRoom(); }