MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / getInheritanceKey

Method getInheritanceKey

plugins/dm.difficulty/DifficultySettings.cpp:298–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298std::string DifficultySettings::getInheritanceKey(const std::string& className)
299{
300 if (className.empty()) return "";
301
302 IEntityClassPtr eclass = GlobalEntityClassManager().findClass(className);
303
304 // Get the inheritance chain of this class
305 std::list<std::string> inheritanceChain;
306 for (IEntityClass* currentClass = eclass.get();
307 currentClass != NULL;
308 currentClass = currentClass->getParent())
309 {
310 inheritanceChain.push_front(currentClass->getDeclName());
311 }
312
313 // Build the inheritance key
314 std::string inheritanceKey;
315 for (std::list<std::string>::const_iterator c = inheritanceChain.begin();
316 c != inheritanceChain.end();
317 c++)
318 {
319 inheritanceKey += (inheritanceKey.empty()) ? "" : "_";
320 inheritanceKey += *c;
321 }
322
323 return inheritanceKey;
324}
325
326SettingPtr DifficultySettings::createSetting(const std::string& className)
327{

Callers

nothing calls this directly

Calls 7

getDeclNameMethod · 0.80
emptyMethod · 0.45
findClassMethod · 0.45
getMethod · 0.45
getParentMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected