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

◆ InitDamageZoneDisplayNameMapping()

void Entity::InitDamageZoneDisplayNameMapping ( )
inlineprivate

Initialize map of damage zone display names for more optimized retrieval.

См. определение в файле 3_Game/DayZ/Entities/EntityAI.c строка 392

393 {
394 string path_base;
395 string path;
396 string component_name;
397
398 if ( IsWeapon() )
399 {
400 path_base = CFG_WEAPONSPATH;
401 }
402 else if ( IsMagazine() )
403 {
404 path_base = CFG_MAGAZINESPATH;
405 }
406 else
407 {
408 path_base = CFG_VEHICLESPATH;
409 }
410
411 path_base = string.Format( "%1 %2 DamageSystem DamageZones", path_base, GetType() );
412
413 if ( !g_Game.ConfigIsExisting(path_base) )
414 {
415 component_name = GetDisplayName();
416 g_Game.FormatRawConfigStringKeys(component_name);
417 m_DamageDisplayNameMap.Insert( "".Hash(), component_name );
418 }
419 else
420 {
421 TStringArray zone_names = new TStringArray;
422 GetDamageZones( zone_names );
423
424 for ( int i = 0; i < zone_names.Count(); i++ )
425 {
426 path = string.Format( "%1 %2 displayName", path_base, zone_names[i] );
427
428 if (g_Game.ConfigIsExisting(path) && g_Game.ConfigGetTextRaw(path,component_name))
429 {
430 g_Game.FormatRawConfigStringKeys(component_name);
431 m_DamageDisplayNameMap.Insert( zone_names[i].Hash(), component_name );
432 }
433 }
434 }
435 }
eBleedingSourceType GetType()
DayZGame g_Game
Определения DayZGame.c:4074
static string GetDisplayName(int liquid_type)
Определения Liquid.c:383
string path
Определения OptionSelectorMultistate.c:142
ref map< int, string > m_DamageDisplayNameMap
class array< Class T > TStringArray
const string CFG_VEHICLESPATH
Определения 3_Game/DayZ/constants.c:228
const string CFG_WEAPONSPATH
Определения 3_Game/DayZ/constants.c:229
const string CFG_MAGAZINESPATH
Определения 3_Game/DayZ/constants.c:230
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.

Перекрестные ссылки CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, string::Format(), g_Game, GetDisplayName(), GetType(), m_DamageDisplayNameMap, path и TStringArray.

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