public void AddLoot(LootType inType, string inId, long inQuantity) { if (condenseLootTypes) { for (int i = 0; i < loot.Count; i++) { if (loot[i].lootType == inType && loot[i].id == inId) { loot[i].quantity += inQuantity; if (enforceMaxQuantities) { loot[i].EnforceMaxQuantity(); } return; } } } //if we made it here it means the loot doesn't exist yet in this bundle Loot newLoot = new Loot(inType, inId, inQuantity); if (enforceMaxQuantities) { newLoot.EnforceMaxQuantity(); } loot.Add(newLoot); }