private void AddLootboxes(XElement root) { foreach (var elem in root.XPathSelectElements("//Lootcase")) { string id = elem.Attribute("id").Value; ushort type; var typeAttr = elem.Attribute("type"); type = (ushort)Utils.FromString(typeAttr.Value); if (type2id_lootBox.ContainsKey(type)) { log.WarnFormat("'{0}' and '{1}' has the same ID of 0x{2:x4}!", id, type2id_equipSet[type], type); } if (id2type_lootBox.ContainsKey(id)) { log.WarnFormat("0x{0:x4} and 0x{1:x4} has the same name of {2}!", type, id2type_equipSet[id], id); } type2id_lootBox[type] = id; id2type_lootBox[id] = type; type2elem_lootBox[type] = elem; lootBox[type] = Lootbox.FromElem(type, elem); } }