private static void Main() { Bakery.GetInstance(); var c = new CustomerFactory(); c.CreateCustomer("Fred"); c.CreateCustomer("Greg"); c.CreateCustomer("Ted"); }
private void Run() { // runs until store is closed while (!Bakery.GetInstance().IsClosed()) { Thread.Sleep(1000); Bakery.GetInstance().SellCookieToCustomer(this); } Console.WriteLine(Name + " went home."); Console.ReadKey(); // to keep console open, so you can read input }