public void ReCreateAllBuns() { var buns = new List <IBun>(); IFactory factory = new CroissantFactory(); buns.Add(factory.CreateBun()); factory = new PretzelFactory(); buns.Add(factory.CreateBun()); factory = new CreamBunFactory(); buns.Add(factory.CreateBun()); this.Buns = buns; }
public void AddNewBuns() { var buns = new List <IBun>(); IFactory factory = new CroissantFactory(); buns.Add(factory.CreateBun()); factory = new PretzelFactory(); buns.Add(factory.CreateBun()); factory = new CreamBunFactory(); buns.Add(factory.CreateBun()); this.Buns.AddRange(buns); }