DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ConfigFindClassIndex()

int CGame::ConfigFindClassIndex ( string config_path,
string searched_member )
inlineprotected

Searches given config path (config_path) for the given member (searched_member) and returns its index. \nReturns -1 if not found.
usage:

int skinning_class_index = g_Game.ConfigFindClassIndex(cfgPath_animal, "Skinning");
DayZGame g_Game
Определения DayZGame.c:3868

См. определение в файле Game.c строка 1419

1420 {
1421 int class_count = ConfigGetChildrenCount(config_path);
1422 for (int index = 0; index < class_count; index++)
1423 {
1424 string found_class = "";
1425 ConfigGetChildName(config_path, index, found_class);
1426 if (found_class == searched_member)
1427 {
1428 return index;
1429 }
1430 }
1431 return -1;
1432 }
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.

Перекрестные ссылки ConfigGetChildName() и ConfigGetChildrenCount().