예제 #1
0
	CEXPORT void* FactoryBuilder(const char* name)
	{
		if (!buildFactory)
			initFactory();

		if (!buildFactory)
			return NULL;

		return buildFactory(name);
	}
예제 #2
0
 void init(){
     // Factory Method --> buildFactory
     unique_ptr<AbstractFactory> factory = buildFactory();
     pEatee = unique_ptr<Herbivore>(factory->createHerbivore());
     pEater = unique_ptr<Carnivore>(factory->createCarnivore());
 }