Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private LootBag SortLootBag(LootBag lootBag)
- {
- var result = new LootBag();
- foreach (var item in lootBag.Items)
- {
- var index = result.Items.FindIndex(i => i.Itemid == item.Itemid);
- if (index == -1)
- {
- result.Items.Add(item);
- }
- else
- {
- result.Items[index].Count += item.Count;
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement