예제 #1
0
 public void ConstructHouse(LuxuryHouseBuilder houseBuilder)
 {
     houseBuilder.BuildFloor();
     houseBuilder.BuildWalls();
     houseBuilder.BuildRoof();
     houseBuilder.BuildDoors();
     houseBuilder.BuildWindows();
     houseBuilder.BuildGarage();
     houseBuilder.BuildServantQuarter();
 }
예제 #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;
        }