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

◆ IsKindOf()

bool CGame::IsKindOf ( string cfg_class_name,
string cfg_parent_name )
inlineprotected

Returns is class name inherited from parent class name.

Аргументы
cfg_class_nameConfig Class name ("Animal_CervusElaphus")
cfg_parent_nameParent Config Class name ("DZ_LightAI")
Возвращает
bool is class name inherited from parent class name
bool is_kind = g_Game.IsKindOf( "Animal_CervusElaphus", "DZ_LightAI");
>> 1
DayZGame g_Game
Определения DayZGame.c:3942
proto string ToString()
class array< Class T > PrintString

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

1413 {
1414 TStringArray full_path = new TStringArray;
1415
1416 ConfigGetFullPath("CfgVehicles " + cfg_class_name, full_path);
1417
1418 if (full_path.Count() == 0)
1419 {
1420 ConfigGetFullPath("CfgAmmo " + cfg_class_name, full_path);
1421 }
1422
1423 if (full_path.Count() == 0)
1424 {
1425 ConfigGetFullPath("CfgMagazines " + cfg_class_name, full_path);
1426 }
1427
1428 if (full_path.Count() == 0)
1429 {
1430 ConfigGetFullPath("cfgWeapons " + cfg_class_name, full_path);
1431 }
1432
1433 if (full_path.Count() == 0)
1434 {
1435 ConfigGetFullPath("CfgNonAIVehicles " + cfg_class_name, full_path);
1436 }
1437
1438 cfg_parent_name.ToLower();
1439 int nFullPath = full_path.Count();
1440 for (int i = 0; i < nFullPath; i++)
1441 {
1442 string tmp = full_path.Get(i);
1443 tmp.ToLower();
1444 if (tmp == cfg_parent_name)
1445 {
1446 return true;
1447 }
1448 }
1449
1450 return false;
1451 }
proto native void ConfigGetFullPath(string path, out TStringArray full_path)
array< string > TStringArray
Определения EnScript.c:712
proto int ToLower()
Changes string to lowercase. Returns length.

Перекрестные ссылки ConfigGetFullPath() и string::ToLower().

Используется в DayZGame().