Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryPurchasing()

override bool Terraria.GameContent.UI.CustomCurrencySingleCoin.TryPurchasing ( long price,
List< Item[]> inv,
List< Point > slotCoins,
List< Point > slotsEmpty,
List< Point > slotEmptyBank,
List< Point > slotEmptyBank2,
List< Point > slotEmptyBank3,
List< Point > slotEmptyBank4 )
inlinevirtual

Reimplemented from Terraria.GameContent.UI.CustomCurrencySystem.

Definition at line 25 of file CustomCurrencySingleCoin.cs.

26 {
28 long num = price;
29 for (int i = 0; i < slotCoins.Count; i++)
30 {
32 long num2 = num;
33 if (inv[item.X][item.Y].stack < num2)
34 {
35 num2 = inv[item.X][item.Y].stack;
36 }
37 num -= num2;
38 inv[item.X][item.Y].stack -= (int)num2;
39 if (inv[item.X][item.Y].stack == 0)
40 {
41 switch (item.X)
42 {
43 case 0:
45 break;
46 case 1:
48 break;
49 case 2:
51 break;
52 case 3:
54 break;
55 case 4:
57 break;
58 }
60 i--;
61 }
62 if (num == 0L)
63 {
64 break;
65 }
66 }
67 if (num != 0L)
68 {
70 return false;
71 }
72 return true;
73 }
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
void ItemCacheRestore(List< Tuple< Point, Item > > cache, List< Item[]> inventories)
List< Tuple< Point, Item > > ItemCacheCreate(List< Item[]> inventories)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.item, Terraria.GameContent.UI.CustomCurrencySystem.ItemCacheCreate(), Terraria.GameContent.UI.CustomCurrencySystem.ItemCacheRestore(), System.L, and System.Collections.Generic.Dictionary< TKey, TValue >.Remove().