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

Method loadRooms

source/utils/ConfigManager.cpp:920–951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

918}
919
920bool ConfigManager::loadRooms(const std::string& fileName)
921{
922 OD_LOG_INF("Load Rooms file: " + fileName);
923 std::stringstream defFile;
924 if(!Helper::readFileWithoutComments(fileName, defFile))
925 {
926 OD_LOG_ERR("Couldn't read " + fileName);
927 return false;
928 }
929
930 std::string nextParam;
931 // Read in the creature class descriptions
932 defFile >> nextParam;
933 if (nextParam != "[Rooms]")
934 {
935 OD_LOG_ERR("Invalid factions start format. Line was " + nextParam);
936 return false;
937 }
938
939 while(defFile.good())
940 {
941 if(!(defFile >> nextParam))
942 break;
943
944 if (nextParam == "[/Rooms]")
945 break;
946
947 defFile >> mRoomsConfig[nextParam];
948 }
949
950 return true;
951}
952
953bool ConfigManager::loadTraps(const std::string& fileName)
954{

Callers

nothing calls this directly

Calls 1

readFileWithoutCommentsFunction · 0.85

Tested by

no test coverage detected