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

◆ EnumFlagsToString()

static string typename::EnumFlagsToString ( typename enumType ,
int value )
inlinestaticprivate

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

615 {
616 // Exact match first (non-flags and exact declared combinations)
617 string exact = enumType.EnumToString(enumType, value);
618 if (exact != "unknown")
619 return exact;
620
621 // unknown handlind
622 if (value == 0)
623 {
624 string zeroName = enumType.EnumToString(enumType, 0);
625 if (zeroName != string.Empty)
626 return zeroName;
627 else
628 return "unknown";
629 }
630
631 // Iterate bits and resolve each flag name
632 int remaining = value;
633 array<string> parts = {};
634 int bit = 1;
635
636 // keep within 32-bit enums
637 for (int i = 0; i < 32 && remaining != 0; ++i)
638 {
639 bit <<= 1;
640 if ((value & bit) != 0)
641 {
642 string name = enumType.EnumToString(enumType, bit);
643 if (name != "unknown")
644 {
645 parts.Insert(name);
646 remaining &= ~bit;
647 }
648 }
649 }
650
651 // If we couldn't map all bits, include the unknown residue in hex
652 if (remaining != 0)
653 parts.Insert(string.Format("0x%1", remaining.ToHex()));
654
655 if (parts.Count() == 0)
656 {
657 // Nothing mapped; last resort: hex of the original value
658 return string.Format("0x%1", value.ToHex());
659 }
660
661 return string.Join("|", parts);
662 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Empty
Определения Hand_States.c:14

Перекрестные ссылки Empty и name.