public void parseItems(List <Item> items) { Utility.consolidateStacks(items); for (int i = 0; i < 6; i++) { this.categoryItems.Add(new List <Item>()); this.categoryTotals.Add(0); this.categoryDials.Add(new MoneyDial(7, i == 5)); } foreach (Item current in items) { if (current is StardewValley.Object) { StardewValley.Object @object = current as StardewValley.Object; int categoryIndexForObject = this.getCategoryIndexForObject(@object); this.categoryItems[categoryIndexForObject].Add(@object); List <int> list = this.categoryTotals; int index = categoryIndexForObject; list[index] += @object.sellToStorePrice() * @object.Stack; Game1.stats.itemsShipped += (uint)@object.Stack; if (@object.Category == -75 || @object.Category == -79) { Game1.stats.CropsShipped += (uint)@object.Stack; } if (@object.countsForShippedCollection()) { Game1.player.shippedBasic(@object.parentSheetIndex, @object.stack); } } } for (int j = 0; j < 5; j++) { List <int> list = this.categoryTotals; list[5] = list[5] + this.categoryTotals[j]; this.categoryItems[5].AddRange(this.categoryItems[j]); this.categoryDials[j].currentValue = this.categoryTotals[j]; this.categoryDials[j].previousTargetValue = this.categoryDials[j].currentValue; } this.categoryDials[5].currentValue = this.categoryTotals[5]; Game1.player.Money += this.categoryTotals[5]; Game1.setRichPresence("earnings", this.categoryTotals[5]); }
public void parseItems(List <Item> items) { Utility.consolidateStacks(items); for (int index = 0; index < 6; ++index) { this.categoryItems.Add(new List <Item>()); this.categoryTotals.Add(0); this.categoryDials.Add(new MoneyDial(7, index == 5)); } foreach (Item obj in items) { if (obj is StardewValley.Object) { StardewValley.Object o = obj as StardewValley.Object; int categoryIndexForObject = this.getCategoryIndexForObject(o); this.categoryItems[categoryIndexForObject].Add((Item)o); List <int> categoryTotals = this.categoryTotals; int index = categoryIndexForObject; categoryTotals[index] = categoryTotals[index] + o.sellToStorePrice() * o.Stack; Game1.stats.itemsShipped += (uint)o.Stack; if (o.Category == -75 || o.Category == -79) { Game1.stats.CropsShipped += (uint)o.Stack; } if (o.countsForShippedCollection()) { Game1.player.shippedBasic(o.parentSheetIndex, o.stack); } } } for (int index = 0; index < 5; ++index) { List <int> categoryTotals = this.categoryTotals; categoryTotals[5] = categoryTotals[5] + this.categoryTotals[index]; this.categoryItems[5].AddRange((IEnumerable <Item>) this.categoryItems[index]); this.categoryDials[index].currentValue = this.categoryTotals[index]; this.categoryDials[index].previousTargetValue = this.categoryDials[index].currentValue; } this.categoryDials[5].currentValue = this.categoryTotals[5]; Game1.player.Money += this.categoryTotals[5]; Game1.setRichPresence("earnings", (object)this.categoryTotals[5]); }