public override void Read() { var itemgroup = new ItemGroup(); var items = new Elements.Items.Items(); var item = new Item(); foreach (string s in Strings) { if (s.StartsWith("// ")) { continue; } if (s.StartsWith("//")) { items = new Elements.Items.Items(); items.Name = s.Replace("//", ""); continue; } if (string.IsNullOrEmpty(s)) { continue; } if (s.StartsWith("0x")) { if (items.Color != Color.Black) { Items.List.Add(items); } items.Color = ReadColorFromInt(s); itemgroup = new ItemGroup(); Items.List.Add(items); continue; } itemgroup = new ItemGroup(); var str = s.Split('/'); itemgroup.Name = str.Last(); var s1 = str[0].Split(separator, StringSplitOptions.RemoveEmptyEntries).ToList(); itemgroup.Percent = int.Parse(s1.First()); s1.Remove(s1.First()); for (int index = 0; index < s1.Count; index++) { DivideEtImpera(index, s1, ref item, itemgroup); } items.List.Add(itemgroup); } }
public override void Read() { var itemgroup = new ItemGroup(); var items = new Elements.Items.Items(); var item = new Item(); foreach (string s in Strings) { if (s.StartsWith("// ")) continue; if(s.StartsWith("//")) { items = new Elements.Items.Items(); items.Name = s.Replace("//", ""); continue; } if(string.IsNullOrEmpty(s)) continue; if (s.StartsWith("0x")) { if(items.Color!=Color.Black) { Items.List.Add(items); } items.Color=ReadColorFromInt(s); itemgroup = new ItemGroup(); Items.List.Add(items); continue; } itemgroup = new ItemGroup(); var str = s.Split('/'); itemgroup.Name = str.Last(); var s1 = str[0].Split(separator, StringSplitOptions.RemoveEmptyEntries).ToList(); itemgroup.Percent = int.Parse(s1.First()); s1.Remove(s1.First()); for (int index = 0; index < s1.Count; index++) { DivideEtImpera(index,s1,ref item, itemgroup); } items.List.Add(itemgroup); } }