DayZ 1.27
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.
Определения Game.c:1339
proto native CGame GetGame()
void PrintString(string s)
Helper for printing out string expression. Example: PrintString("Hello " + var);.
Определения EnScript.c:345

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

1340 {
1341 TStringArray full_path = new TStringArray;
1342
1343 ConfigGetFullPath("CfgVehicles " + cfg_class_name, full_path);
1344
1345 if (full_path.Count() == 0)
1346 {
1347 ConfigGetFullPath("CfgAmmo " + cfg_class_name, full_path);
1348 }
1349
1350 if (full_path.Count() == 0)
1351 {
1352 ConfigGetFullPath("CfgMagazines " + cfg_class_name, full_path);
1353 }
1354
1355 if (full_path.Count() == 0)
1356 {
1357 ConfigGetFullPath("cfgWeapons " + cfg_class_name, full_path);
1358 }
1359
1360 if (full_path.Count() == 0)
1361 {
1362 ConfigGetFullPath("CfgNonAIVehicles " + cfg_class_name, full_path);
1363 }
1364
1365 cfg_parent_name.ToLower();
1366 for (int i = 0; i < full_path.Count(); i++)
1367 {
1368 string tmp = full_path.Get(i);
1369 tmp.ToLower();
1370 if (tmp == cfg_parent_name)
1371 {
1372 return true;
1373 }
1374 }
1375
1376 return false;
1377 }
proto native void ConfigGetFullPath(string path, out TStringArray full_path)
array< string > TStringArray
Определения EnScript.c:685
proto int ToLower()
Changes string to lowercase. Returns length.

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

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