DayZ 1.28
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 = GetGame().IsKindOf( "Animal_CervusElaphus", "DZ_LightAI");
>> 1
proto string ToString()
bool IsKindOf(string cfg_class_name, string cfg_parent_name)
Returns is class name inherited from parent class name.
Определения Global/game.c:1394
proto native CGame GetGame()
class array< Class T > PrintString

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

1395 {
1396 TStringArray full_path = new TStringArray;
1397
1398 ConfigGetFullPath("CfgVehicles " + cfg_class_name, full_path);
1399
1400 if (full_path.Count() == 0)
1401 {
1402 ConfigGetFullPath("CfgAmmo " + cfg_class_name, full_path);
1403 }
1404
1405 if (full_path.Count() == 0)
1406 {
1407 ConfigGetFullPath("CfgMagazines " + cfg_class_name, full_path);
1408 }
1409
1410 if (full_path.Count() == 0)
1411 {
1412 ConfigGetFullPath("cfgWeapons " + cfg_class_name, full_path);
1413 }
1414
1415 if (full_path.Count() == 0)
1416 {
1417 ConfigGetFullPath("CfgNonAIVehicles " + cfg_class_name, full_path);
1418 }
1419
1420 cfg_parent_name.ToLower();
1421 for (int i = 0; i < full_path.Count(); i++)
1422 {
1423 string tmp = full_path.Get(i);
1424 tmp.ToLower();
1425 if (tmp == cfg_parent_name)
1426 {
1427 return true;
1428 }
1429 }
1430
1431 return false;
1432 }
proto native void ConfigGetFullPath(string path, out TStringArray full_path)
array< string > TStringArray
Определения EnScript.c:709
proto int ToLower()
Changes string to lowercase. Returns length.

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

Используется в DayZGame(), SceneObject::Init(), ManBase::SpawnAI() и ManBase::SpawnEntityOnGroundPos().