Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LootSimulationItemCounter.cs
Go to the documentation of this file.
2using System.Linq;
3using Terraria.ID;
4
6
8{
9 private long[] _itemCountsObtained = new long[ItemID.Count];
10
11 private long[] _itemCountsObtainedExpert = new long[ItemID.Count];
12
14
16
17 public void AddItem(int itemId, int amount, bool expert)
18 {
19 if (expert)
20 {
22 }
23 else
24 {
25 _itemCountsObtained[itemId] += amount;
26 }
27 }
28
29 public void Exclude(params int[] itemIds)
30 {
31 foreach (int num in itemIds)
32 {
33 _itemCountsObtained[num] = 0L;
35 }
36 }
37
38 public void IncreaseTimesAttempted(int amount, bool expert)
39 {
40 if (expert)
41 {
43 }
44 else
45 {
47 }
48 }
49
50 public string PrintCollectedItems(bool expert)
51 {
54 if (expert)
55 {
58 }
59 IEnumerable<string> values = from entry in collectionToUse.Select((long count, int itemId) => new { itemId, count })
60 where entry.count > 0
61 select entry.itemId into itemId
62 select $"new ItemDropInfo(ItemID.{ItemID.Search.GetName(itemId)}, {collectionToUse[itemId]}, {totalDropsAttempted})";
63 return string.Join(",\n", values);
64 }
65}
static readonly short Count
Definition ItemID.cs:12138