Ejemplo n.º 1
0
 public void ConstructHouse(BasicHouseBuilder houseBuilder)
 {
     houseBuilder.BuildFloor();
     houseBuilder.BuildWalls();
     houseBuilder.BuildRoof();
     houseBuilder.BuildDoors();
     houseBuilder.BuildWindows();
 }
Ejemplo n.º 2
0
        public static void BuildHouse()
        {
            HouseDirector houseDirector = new HouseDirector();

            BasicHouseBuilder basicHouseBuilder = new BasicHouseBuilder();

            houseDirector.ConstructHouse(basicHouseBuilder);
            var basicHouse = basicHouseBuilder.House;

            LuxuryHouseBuilder luxuryHouseBuilder = new LuxuryHouseBuilder();

            houseDirector.ConstructHouse(luxuryHouseBuilder);
            var luxuryHouse = basicHouseBuilder.House;

            RoyalHouseBuilder royalHouseBuilder = new RoyalHouseBuilder();

            houseDirector.ConstructHouse(royalHouseBuilder);
            var royalHouse = basicHouseBuilder.House;
        }