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

Method loadGlobalConfigDefinitionFiles

source/utils/ConfigManager.cpp:228–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228bool ConfigManager::loadGlobalConfigDefinitionFiles(std::stringstream& configFile)
229{
230 std::string nextParam;
231 uint32_t filesOk = 0;
232 while(configFile.good())
233 {
234 if(!(configFile >> nextParam))
235 break;
236
237 if(nextParam == "[/ConfigFiles]")
238 break;
239
240 if(nextParam != "[ConfigFile]")
241 {
242 OD_LOG_ERR("Wrong parameter read nextParam=" + nextParam);
243 return false;
244 }
245
246 uint32_t paramsOk = 0;
247 std::string type;
248 std::string fileName;
249 while(configFile.good())
250 {
251 if(!(configFile >> nextParam))
252 break;
253
254 if(nextParam == "[/ConfigFile]")
255 {
256 break;
257 }
258
259 if(nextParam == "Type")
260 {
261 configFile >> type;
262 paramsOk |= 0x01;
263 continue;
264 }
265
266 if(nextParam == "Filename")
267 {
268 configFile >> fileName;
269 paramsOk |= 0x02;
270 continue;
271 }
272 }
273
274 if(paramsOk != 0x03)
275 {
276 OD_LOG_ERR("Missing parameters paramsOk=" + Helper::toString(paramsOk));
277 return false;
278 }
279
280 if(type == "Creatures")
281 {
282 mFilenameCreatureDefinition = fileName;
283 filesOk |= 1;
284 }
285 else if(type == "Equipments")

Callers

nothing calls this directly

Calls 1

toStringFunction · 0.70

Tested by

no test coverage detected