Пример #1
0
        public UsingExample()
        {
            List<House> allHouses = new List<House>();

            HouseBuilder houseBuilder = new WoodenHouseBuilder("OOO WoodIsBest");

            House h1 = houseBuilder.Create();
            allHouses.Add(h1);

            // меняем застройщика:
            houseBuilder = new PanelHouseBuilder("Private Panels");
            allHouses.Add(houseBuilder.Create());

            foreach (var house in allHouses)
            {
                Console.WriteLine(house.HouseType);
            }
        }
Пример #2
0
        public UsingExample()
        {
            List <House> allHouses = new List <House>();

            HouseBuilder houseBuilder = new WoodenHouseBuilder("OOO WoodIsBest");

            House h1 = houseBuilder.Create();

            allHouses.Add(h1);

            // меняем застройщика:
            houseBuilder = new PanelHouseBuilder("Private Panels");
            allHouses.Add(houseBuilder.Create());

            foreach (var house in allHouses)
            {
                Console.WriteLine(house.HouseType);
            }
        }