MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / loadSkills

Method loadSkills

source/utils/ConfigManager.cpp:1019–1049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017}
1018
1019bool ConfigManager::loadSkills(const std::string& fileName)
1020{
1021 OD_LOG_INF("Load Skills file: " + fileName);
1022 std::stringstream defFile;
1023 if(!Helper::readFileWithoutComments(fileName, defFile))
1024 {
1025 OD_LOG_ERR("Couldn't read " + fileName);
1026 return false;
1027 }
1028
1029 std::string nextParam;
1030 // Read in the creature class descriptions
1031 defFile >> nextParam;
1032 if (nextParam != "[Skills]")
1033 {
1034 OD_LOG_ERR("Invalid Skills start format. Line was " + nextParam);
1035 return false;
1036 }
1037
1038 while(defFile.good())
1039 {
1040 if(!(defFile >> nextParam))
1041 break;
1042
1043 if (nextParam == "[/Skills]")
1044 break;
1045
1046 defFile >> mSkillPoints[nextParam];
1047 }
1048 return true;
1049}
1050
1051bool ConfigManager::loadTilesets(const std::string& fileName)
1052{

Callers

nothing calls this directly

Calls 1

readFileWithoutCommentsFunction · 0.85

Tested by

no test coverage detected