public Patient(WaitingRoom wr) { ok = false; this.wr = wr; wr.NumberChange += ReactToNumber; this.numberInQueue = this.wr.DrawNumber(); Console.Out.WriteLine("Patient " + numberInQueue + " enters waiting room"); }
static void Main(string[] args) { WaitingRoom waitingRoom = new WaitingRoom(); Patient p1 = new Patient(waitingRoom); Patient p2 = new Patient(waitingRoom); Patient p3 = new Patient(waitingRoom); waitingRoom.RunWaitingRoom(); }