Beispiel #1
0
// Static function to create an EntityClass (named constructor idiom)
Doom3EntityClassPtr Doom3EntityClass::create(const std::string& name, bool brushes) {
	if (!brushes) {
		return Doom3EntityClassPtr(new Doom3EntityClass(name, 
													Vector3(-1, -1, -1),
													true, 
													Vector3(-8, -8, -8),
													Vector3(8, 8, 8)));
	}
	else {
		return Doom3EntityClassPtr(new Doom3EntityClass(name));
	}
}
Doom3EntityClassPtr EClassManager::findInternal(const std::string& name) const
{
    // Find the EntityClass in the map.
    EntityClasses::const_iterator i = _entityClasses.find(name);
    if (i != _entityClasses.end())
    {
        return i->second;
    }
    else
    {
        return Doom3EntityClassPtr();
    }
}