Example #1
0
GameObject * ObjectFactory::create(const std::string & typeID)
{
	std::map<std::string, BaseCreator*>::iterator it = m_creators.find(typeID);

	if (it == m_creators.end())
	{
		Log::Instance()->write("Error : could not find type.");
		return false;
	}

	BaseCreator * pCreator = it->second;
	return pCreator->createObject();
}
Example #2
0
Object* ObjectFactory::create(std::string typeId)
{
    std::map<std::string, BaseCreator*>::iterator it = creators.find(typeId);

    if (it == creators.end())
    {
        LOGerr("Could not find type " << typeId);
        return NULL;
    }

    BaseCreator* creator = (*it).second;

    return creator->createObject();
}