| 918 | } |
| 919 | |
| 920 | bool 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 | |
| 953 | bool ConfigManager::loadTraps(const std::string& fileName) |
| 954 | { |
nothing calls this directly
no test coverage detected