| 296 | } |
| 297 | |
| 298 | std::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 | |
| 326 | SettingPtr DifficultySettings::createSetting(const std::string& className) |
| 327 | { |