コード例 #1
0
        public House ConstructWoodenHouse()
        {
            IHouseBuilder builder = new WoodenHouseBuilder();

            builder.BuildBasement();
            builder.BuildInterior();
            builder.BuildStructure();
            builder.BuildRoof();
            return(builder.GetHouse());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: dzlatarov/Design-Patterns
        public static void Main(string[] args)
        {
            var director = new Director();

            StoneHouseBuilder stoneBuilder = new StoneHouseBuilder();

            director.ConstructorStoneHouse(stoneBuilder);
            StoneHouse stoneHouse = stoneBuilder.GetHouse();

            WoodenHouseBuilder woodBuilder = new WoodenHouseBuilder();

            director.ConstructorWoodenHouse(woodBuilder);
            WoodenHouse woodHouse = woodBuilder.GetHouse();
        }