CEXPORT void* FactoryBuilder(const char* name) { if (!buildFactory) initFactory(); if (!buildFactory) return NULL; return buildFactory(name); }
void init(){ // Factory Method --> buildFactory unique_ptr<AbstractFactory> factory = buildFactory(); pEatee = unique_ptr<Herbivore>(factory->createHerbivore()); pEater = unique_ptr<Carnivore>(factory->createCarnivore()); }