public void update(NumberGenerator generator) { Console.WriteLine($"DigitObserver: {generator.getNumber()}"); try { Thread.Sleep(100); } catch (ThreadInterruptedException) { } }
public void update(NumberGenerator generator) { Console.Write("GraphObserver:"); int count = generator.getNumber(); for (int i = 0; i < count; i++) { Console.Write("*"); } Console.WriteLine(""); try { Thread.Sleep(100); } catch (ThreadInterruptedException) { } }