26 lines
484 B
C++
26 lines
484 B
C++
|
#include "BuilderPattern.h"
|
|||
|
|
|||
|
int main()
|
|||
|
{
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
AbstractBuilder *builder;
|
|||
|
//ָ<><D6B8><EFBFBD><EFBFBD>
|
|||
|
Director *director = new Director();
|
|||
|
//<2F><>Ʒ<EFBFBD><C6B7>House
|
|||
|
House *house;
|
|||
|
|
|||
|
//ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>彨<EFBFBD><E5BDA8><EFBFBD><EFBFBD>A
|
|||
|
builder = new ConcreteBuilderA();
|
|||
|
director->setBuilder(builder);
|
|||
|
house = director->construct();
|
|||
|
house->printfHouseInfo();
|
|||
|
|
|||
|
//ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD>彨<EFBFBD><E5BDA8><EFBFBD><EFBFBD>B
|
|||
|
builder = new ConcreteBuilderB();
|
|||
|
director->setBuilder(builder);
|
|||
|
house = director->construct();
|
|||
|
house->printfHouseInfo();
|
|||
|
|
|||
|
system("pause");
|
|||
|
return 0;
|
|||
|
}
|