DayZ 1.28
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

См. определение в файле Global/game.c строка 1474

1475 {
1476 int class_count = ConfigGetChildrenCount(config_path);
1477 for (int index = 0; index < class_count; index++)
1478 {
1479 string found_class = "";
1480 ConfigGetChildName(config_path, index, found_class);
1481 if (found_class == searched_member)
1482 {
1483 return index;
1484 }
1485 }
1486 return -1;
1487 }
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().