private static void AddWeapon(XmlNode skill) { Dictionary <string, string> data; byte type; Dictionary <byte, WeaponInfo> nentry = new Dictionary <byte, WeaponInfo>(); type = byte.Parse(skill.ChildNodes[0].InnerText); for (int i = 0; i < skill.ChildNodes.Count - 1; i++) { WeaponInfo nweapon = new WeaponInfo(); data = new Dictionary <string, string>(); XmlNodeList childList = skill.ChildNodes[i + 1].ChildNodes; for (int j = 0; j < childList.Count; j++) { data.Add(childList.Item(j).Name, childList.Item(j).InnerText); } if (!data.ContainsKey("Level")) { continue; } try { nweapon.level = byte.Parse(data["Level"]); nweapon.maxdurability = uint.Parse(data["MaxDurability"]); nweapon.minatk = uint.Parse(data["MinAtk"]); nweapon.maxatk = uint.Parse(data["MaxAtk"]); nweapon.minrangeatk = uint.Parse(data["MinRangeAtk"]); nweapon.maxrangeatk = uint.Parse(data["MaxRangeAtk"]); nweapon.minmatk = uint.Parse(data["MinMagicAtk"]); nweapon.maxmatk = uint.Parse(data["MaxMagicAtk"]); nentry.Add(nweapon.level, nweapon); } catch (Exception e) { Logger.ShowError("cannot parse: " + data["skillId"], null); Logger.ShowError(e, null); return; } } weapons.Add(type, nentry); }
private static void AddWeapon(XmlNode skill) { Dictionary<string, string> data; byte type; Dictionary<byte, WeaponInfo> nentry = new Dictionary<byte, WeaponInfo>(); type = byte.Parse(skill.ChildNodes[0].InnerText); for (int i = 0; i < skill.ChildNodes.Count - 1; i++) { WeaponInfo nweapon=new WeaponInfo(); data = new Dictionary<string, string>(); XmlNodeList childList = skill.ChildNodes[i + 1].ChildNodes; for (int j = 0; j < childList.Count; j++) data.Add(childList.Item(j).Name, childList.Item(j).InnerText); if (!data.ContainsKey("Level")) continue; try { nweapon.level = byte.Parse(data["Level"]); nweapon.maxdurability = uint.Parse(data["MaxDurability"]); nweapon.minatk = uint.Parse(data["MinAtk"]); nweapon.maxatk = uint.Parse(data["MaxAtk"]); nweapon.minrangeatk = uint.Parse(data["MinRangeAtk"]); nweapon.maxrangeatk = uint.Parse(data["MaxRangeAtk"]); nweapon.minmatk = uint.Parse(data["MinMagicAtk"]); nweapon.maxmatk = uint.Parse(data["MaxMagicAtk"]); nentry.Add(nweapon.level, nweapon); } catch (Exception e) { Logger.ShowError("cannot parse: " + data["skillId"], null); Logger.ShowError(e, null); return; } } weapons.Add(type, nentry); }