std::string DifficultySettings::getInheritanceKey(const std::string& className) { if (className.empty()) return ""; IEntityClassPtr eclass = GlobalEntityClassManager().findClass(className); // Get the inheritance chain of this class std::list<std::string> inheritanceChain; for (const IEntityClass* currentClass = eclass.get(); currentClass != NULL; currentClass = currentClass->getParent()) { inheritanceChain.push_front(currentClass->getName()); } // Build the inheritance key std::string inheritanceKey; for (std::list<std::string>::const_iterator c = inheritanceChain.begin(); c != inheritanceChain.end(); c++) { inheritanceKey += (inheritanceKey.empty()) ? "" : "_"; inheritanceKey += *c; } return inheritanceKey; }