Ejemplo n.º 1
0
	CEXPORT void* FactoryBuilder(const char* name)
	{
		if (!buildFactory)
			initFactory();

		if (!buildFactory)
			return NULL;

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