DayZ 1.29
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:3942

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

1495 {
1496 int class_count = ConfigGetChildrenCount(config_path);
1497 for (int index = 0; index < class_count; index++)
1498 {
1499 string found_class = "";
1500 ConfigGetChildName(config_path, index, found_class);
1501 if (found_class == searched_member)
1502 {
1503 return index;
1504 }
1505 }
1506 return -1;
1507 }
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().