Add addObjects to add multiple objects in one step
This commit is contained in:
@@ -92,24 +92,7 @@ void *Type::createInstanceByName(const char* TypeName, bool bLoadModule)
|
||||
{
|
||||
// if not already, load the module
|
||||
if(bLoadModule)
|
||||
{
|
||||
// cut out the module name
|
||||
string Mod = getModuleName(TypeName);
|
||||
// ignore base modules
|
||||
if(Mod != "App" && Mod != "Gui" && Mod != "Base")
|
||||
{
|
||||
// remember already loaded modules
|
||||
set<string>::const_iterator pos = loadModuleSet.find(Mod);
|
||||
if(pos == loadModuleSet.end())
|
||||
{
|
||||
Interpreter().loadModule(Mod.c_str());
|
||||
#ifdef FC_LOGLOADMODULE
|
||||
Console().Log("Act: Module %s loaded through class %s \n",Mod.c_str(),TypeName);
|
||||
#endif
|
||||
loadModuleSet.insert(Mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
importModule(TypeName);
|
||||
|
||||
// now the type should be in the type map
|
||||
Type t = fromName(TypeName);
|
||||
@@ -117,7 +100,24 @@ void *Type::createInstanceByName(const char* TypeName, bool bLoadModule)
|
||||
return 0;
|
||||
|
||||
return t.createInstance();
|
||||
}
|
||||
|
||||
void Type::importModule(const char* TypeName)
|
||||
{
|
||||
// cut out the module name
|
||||
string Mod = getModuleName(TypeName);
|
||||
// ignore base modules
|
||||
if (Mod != "App" && Mod != "Gui" && Mod != "Base") {
|
||||
// remember already loaded modules
|
||||
set<string>::const_iterator pos = loadModuleSet.find(Mod);
|
||||
if (pos == loadModuleSet.end()) {
|
||||
Interpreter().loadModule(Mod.c_str());
|
||||
#ifdef FC_LOGLOADMODULE
|
||||
Console().Log("Act: Module %s loaded through class %s \n",Mod.c_str(),TypeName);
|
||||
#endif
|
||||
loadModuleSet.insert(Mod);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string Type::getModuleName(const char* ClassName)
|
||||
|
||||
Reference in New Issue
Block a user