public Bouquet Menu() { Console.Clear(); OutputMenu(); Bouquet newBouquet = null; char mode = ' '; do { mode = Program.EnterMode(); switch (mode) { case 'o': OutputMenu(); break; case 'w': newBouquet = Source.ConstructWeddingBouquet(); break; case 'a': newBouquet = Source.ConstructАnniversaryBouquet(); break; case 'c': newBouquet = Source.ConstructCustomBouquet(); break; case 'q': break; default: Console.WriteLine(" < Wrong mode > "); break; } } while (mode != 'q' && newBouquet == null); Console.Clear(); return(newBouquet); }
public SignedBouquet(Bouquet bouquet, Postcard postcard) : base(bouquet) { mainConstructor(postcard); }
public static void Menu() { MainMenu(); char mode = ' '; Bouquet currentBuquet = null; FlowerShop shop = FlowerShop.GetSource(); do { mode = Program.EnterMode(); switch (mode) { case 'o': MainMenu(); break; case 'c': shop.SetBuilder(new CascadeBouquetBuilder()); currentBuquet = shop.Menu(); MainMenu(); break; case 'r': shop.SetBuilder(new RoundBouquetBuilder()); currentBuquet = shop.Menu(); MainMenu(); break; case 't': shop.SetBuilder(new TriangularBouquetBuilder()); currentBuquet = shop.Menu(); MainMenu(); break; case 'i': if (currentBuquet != null) { currentBuquet.GetInfo(); } else { Console.WriteLine(" < Bouquet wasn't constructed > "); } break; case 'w': if (currentBuquet != null) { BouquetWrapper wrapper = new BouquetWrapper(); wrapper.ChooseWrapper(); MainMenu(); currentBuquet = new WrappedBouquet(currentBuquet, wrapper); } else { Console.WriteLine(" < Bouquet wasn't constructed > "); } break; case 'p': if (currentBuquet != null) { Postcard postcard = new Postcard(); postcard.SignPostcard(); currentBuquet = new SignedBouquet(currentBuquet, postcard); } else { Console.WriteLine(" < Bouquet wasn't constructed > "); } break; case 'q': break; default: Console.WriteLine(" < Wrong mode > "); break; } } while (mode != 'q'); }
protected Bouquet(Bouquet bouquet) { }
public BouquetDecorator(Bouquet bouquet) : base(bouquet) { Wrapper = null; Postcard = null; this.bouquet = bouquet; }
public WrappedBouquet(Bouquet bouquet, BouquetWrapper wrapper) : base(bouquet) { mainConstructor(wrapper); }