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

◆ GetValidDepenentPartsArray()

array< string > GetValidDepenentPartsArray ( string part_name,
array< string > recurs = null )
protected

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

500 {
501 string name;
502 string cfg_path;
503 ref array<string> dependent_parts;
504
505 for ( int i = 0; i < m_ConstructionParts.Count(); ++i )
506 {
507 name = m_ConstructionParts.GetKey( i );
508 ConstructionPart construction_part = m_ConstructionParts.Get( name );
509
510 if ( construction_part.IsBuilt() && construction_part.GetRequiredParts() && construction_part.GetRequiredParts().Find( part_name ) > -1 ) //does the construction part need 'part_name' to exist?
511 {
512 if ( !dependent_parts )
513 {
514 dependent_parts = new array<string>;
515 }
516
517 if ( !recurs || (recurs.Find(name) == -1 ) )
518 {
519 dependent_parts.Insert(name);
520 }
521// Print("part #" + i + ": " + name);
522 }
523 }
524
525 //fully recursive search, disconnected (unnescessary)
526 /*if (dependent_parts)
527 {
528 if ( dependent_parts.Count() > 0 )
529 {
530 ref array<string> temp = new array<string>;
531 for ( i = 0; i < dependent_parts.Count(); i++ )
532 {
533 temp = GetValidDepenentPartsArray(dependent_parts.Get(i),dependent_parts);
534 if (temp.Count() > 0)
535 {
536 dependent_parts.InsertAll(temp);
537 }
538 }
539 }
540 Print("dependent_parts.Count(): " + dependent_parts.Count());
541 }*/
542 return dependent_parts;
543 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ref map< string, ref ConstructionPart > m_ConstructionParts
Определения Construction.c:15
bool IsBuilt()
Определения ConstructionPart.c:45
array< string > GetRequiredParts()
Определения ConstructionPart.c:75
Result for an object found in CGame.IsBoxCollidingGeometryProxy.

Перекрестные ссылки ConstructionPart::GetRequiredParts(), ConstructionPart::IsBuilt(), m_ConstructionParts и name.

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