31 lines
538 B
C++
31 lines
538 B
C++
#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();
|
||
delete builder;
|
||
|
||
//寧땍야竟쉔芚諒B
|
||
builder = new ConcreteBuilderB();
|
||
director->setBuilder(builder);
|
||
house = director->construct();
|
||
house->printfHouseInfo();
|
||
|
||
system("pause");
|
||
|
||
delete director;
|
||
delete builder;
|
||
|
||
return 0;
|
||
} |