DesignPattern/04.BuilderPattern/2.Code/main.cpp

26 lines
484 B
C++
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include "BuilderPattern.h"
int main()
{
//녜蹶쉔芚諒
AbstractBuilder *builder;
//寧뿐諒
Director *director = new Director();
//끓틔House
House *house;
//寧땍야竟쉔芚諒A
builder = new ConcreteBuilderA();
director->setBuilder(builder);
house = director->construct();
house->printfHouseInfo();
//寧땍야竟쉔芚諒B
builder = new ConcreteBuilderB();
director->setBuilder(builder);
house = director->construct();
house->printfHouseInfo();
system("pause");
return 0;
}