public void contributeToTreeNode(TreeNode node) { node.Nodes.Add("header = " + Utility.FormatHex(header)); node.Nodes.Add("success_flag = " + success_flag); TreeNode intStatsNode = node.Nodes.Add("_intStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_IntStats) != 0) { _intStatsTable.contributeToTreeNode(intStatsNode); } TreeNode int64StatsNode = node.Nodes.Add("_int64StatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_Int64Stats) != 0) { _int64StatsTable.contributeToTreeNode(int64StatsNode); } TreeNode boolStatsNode = node.Nodes.Add("_boolStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_BoolStats) != 0) { _boolStatsTable.contributeToTreeNode(boolStatsNode); } TreeNode floatStatsNode = node.Nodes.Add("_floatStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_FloatStats) != 0) { _floatStatsTable.contributeToTreeNode(floatStatsNode); } TreeNode strStatsNode = node.Nodes.Add("_strStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_StringStats) != 0) { _strStatsTable.contributeToTreeNode(strStatsNode); } TreeNode didStatsNode = node.Nodes.Add("_didStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_DataIDStats) != 0) { _didStatsTable.contributeToTreeNode(didStatsNode); } TreeNode spellsNode = node.Nodes.Add("_spellBook = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_SpellList) != 0) { for (int i = 0; i < _spellsTable.list.Count; i++) { uint i_spell_id = _spellsTable.list[i] & 0x7FFFFFFF; uint enchantment_flag = _spellsTable.list[i] & 0x80000000; TreeNode spellIDNode = spellsNode.Nodes.Add($"({i_spell_id}) " + (SpellID)i_spell_id); if (enchantment_flag != 0) { spellIDNode.Nodes.Add("enchantment_flag = On"); } else { spellIDNode.Nodes.Add("enchantment_flag = Off"); } } } TreeNode armorProfileNode = node.Nodes.Add("_armorProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ArmorProfile) != 0) { _armorProfileTable.contributeToTreeNode(armorProfileNode); } TreeNode creatureProfileNode = node.Nodes.Add("_creatureProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_CreatureProfile) != 0) { _creatureProfileTable.contributeToTreeNode(creatureProfileNode); } TreeNode weaponProfileNode = node.Nodes.Add("_weaponProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_WeaponProfile) != 0) { _weaponProfileTable.contributeToTreeNode(weaponProfileNode); } TreeNode hooksNode = node.Nodes.Add("_hookProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_HookProfile) != 0) { _hookProfileTable.contributeToTreeNode(hooksNode); } TreeNode armorEnchantmentNode = node.Nodes.Add("_armorEnchantments = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ArmorEnchant) != 0) { armorEnchantmentNode.Nodes.Add("bitfield = " + Utility.FormatHex(_armorEnchantment)); // Loop over the enum types and add all the applicable ones foreach (ArmorEnchantment_BFIndex armorEnchantmentType in Enum.GetValues(typeof(ArmorEnchantment_BFIndex))) { if ((_armorEnchantment & (uint)armorEnchantmentType) != 0) { armorEnchantmentNode.Nodes.Add(Enum.GetName(typeof(ArmorEnchantment_BFIndex), armorEnchantmentType)); } } } TreeNode weaponEnchantmentNode = node.Nodes.Add("_weaponEnchanments = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_WeaponEnchant) != 0) { weaponEnchantmentNode.Nodes.Add("bitfield = " + Utility.FormatHex(_weaponEnchantment)); // Loop over the enum types and add all the applicable ones foreach (WeaponEnchantment_BFIndex weaponEnchantmentType in Enum.GetValues(typeof(WeaponEnchantment_BFIndex))) { if ((_weaponEnchantment & (uint)weaponEnchantmentType) != 0) { weaponEnchantmentNode.Nodes.Add(Enum.GetName(typeof(WeaponEnchantment_BFIndex), weaponEnchantmentType)); } } } TreeNode resistEnchantmentNode = node.Nodes.Add("_resistEnchantments = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ResistEnchant) != 0) { resistEnchantmentNode.Nodes.Add("bitfield = " + Utility.FormatHex(_resistEnchantment)); // Loop over the enum types and add all the applicable ones foreach (ResistanceEnchantment_BFIndex resistEnchantmentType in Enum.GetValues(typeof(ResistanceEnchantment_BFIndex))) { if ((_resistEnchantment & (uint)resistEnchantmentType) != 0) { resistEnchantmentNode.Nodes.Add(Enum.GetName(typeof(ResistanceEnchantment_BFIndex), resistEnchantmentType)); } } } TreeNode armorLevelsNode = node.Nodes.Add("_armorLevels = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ArmorLevels) != 0) { _armorLevelsTable.contributeToTreeNode(armorLevelsNode); } }
public void contributeToTreeNode(TreeNode node) { node.Nodes.Add("header = " + header); node.Nodes.Add("success_flag = " + success_flag); TreeNode intStatsNode = node.Nodes.Add("_intStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_IntStats) != 0) { _intStatsTable.contributeToTreeNode(intStatsNode); } TreeNode int64StatsNode = node.Nodes.Add("_int64StatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_Int64Stats) != 0) { _int64StatsTable.contributeToTreeNode(int64StatsNode); } TreeNode boolStatsNode = node.Nodes.Add("_boolStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_BoolStats) != 0) { _boolStatsTable.contributeToTreeNode(boolStatsNode); } TreeNode floatStatsNode = node.Nodes.Add("_floatStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_FloatStats) != 0) { _floatStatsTable.contributeToTreeNode(floatStatsNode); } TreeNode strStatsNode = node.Nodes.Add("_strStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_StringStats) != 0) { _strStatsTable.contributeToTreeNode(strStatsNode); } TreeNode didStatsNode = node.Nodes.Add("_didStatsTable = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_DataIDStats) != 0) { _didStatsTable.contributeToTreeNode(didStatsNode); } TreeNode spellsNode = node.Nodes.Add("_spellBook = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_SpellList) != 0) { _spellsTable.contributeToTreeNode(spellsNode); } TreeNode armorProfileNode = node.Nodes.Add("_armorProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ArmorProfile) != 0) { _armorProfileTable.contributeToTreeNode(armorProfileNode); } TreeNode creatureProfileNode = node.Nodes.Add("_creatureProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_CreatureProfile) != 0) { _creatureProfileTable.contributeToTreeNode(creatureProfileNode); } TreeNode weaponProfileNode = node.Nodes.Add("_weaponProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_WeaponProfile) != 0) { _weaponProfileTable.contributeToTreeNode(weaponProfileNode); } TreeNode hooksNode = node.Nodes.Add("_hookProfile = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_HookProfile) != 0) { _hookProfileTable.contributeToTreeNode(hooksNode); } TreeNode armorEnchantmentNode = node.Nodes.Add("_armorEnchantments = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ArmorEnchant) != 0) { armorEnchantmentNode.Nodes.Add("bitfield = " + _armorEnchantment); // Loop over the enum types and add all the applicable ones foreach (ArmorEnchantment_BFIndex armorEnchantmentType in Enum.GetValues(typeof(ArmorEnchantment_BFIndex))) { if ((_armorEnchantment & (uint)armorEnchantmentType) != 0) { armorEnchantmentNode.Nodes.Add(Enum.GetName(typeof(ArmorEnchantment_BFIndex), armorEnchantmentType)); } } } TreeNode weaponEnchantmentNode = node.Nodes.Add("_weaponEnchanments = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_WeaponEnchant) != 0) { weaponEnchantmentNode.Nodes.Add("bitfield = " + _weaponEnchantment); // Loop over the enum types and add all the applicable ones foreach (WeaponEnchantment_BFIndex weaponEnchantmentType in Enum.GetValues(typeof(WeaponEnchantment_BFIndex))) { if ((_weaponEnchantment & (uint)weaponEnchantmentType) != 0) { weaponEnchantmentNode.Nodes.Add(Enum.GetName(typeof(WeaponEnchantment_BFIndex), weaponEnchantmentType)); } } } TreeNode resistEnchantmentNode = node.Nodes.Add("_resistEnchantments = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ResistEnchant) != 0) { resistEnchantmentNode.Nodes.Add("bitfield = " + _resistEnchantment); // Loop over the enum types and add all the applicable ones foreach (ResistanceEnchantment_BFIndex resistEnchantmentType in Enum.GetValues(typeof(ResistanceEnchantment_BFIndex))) { if ((_resistEnchantment & (uint)resistEnchantmentType) != 0) { resistEnchantmentNode.Nodes.Add(Enum.GetName(typeof(ResistanceEnchantment_BFIndex), resistEnchantmentType)); } } } TreeNode armorLevelsNode = node.Nodes.Add("_armorLevels = "); if ((header & (uint)AppraisalProfilePackHeader.Packed_ArmorLevels) != 0) { _armorLevelsTable.contributeToTreeNode(armorLevelsNode); } }