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

◆ this[SlotId id]

Definition at line 97 of file SlotVector.cs.

98 {
99 get
100 {
101 uint index = id.Index;
102 if (index >= _array.Length)
103 {
104 throw new ArgumentOutOfRangeException();
105 }
106 if (!_array[index].Id.IsActive || id != _array[index].Id)
107 {
108 throw new KeyNotFoundException();
109 }
110 return _array[index].Value;
111 }
112 set
113 {
114 uint index = id.Index;
115 if (index >= _array.Length)
116 {
117 throw new ArgumentOutOfRangeException();
118 }
119 if (!_array[index].Id.IsActive || id != _array[index].Id)
120 {
121 throw new KeyNotFoundException();
122 }
123 _array[index] = new ItemPair(value, id);
124 }
125 }
readonly ItemPair[] _array
Definition SlotVector.cs:63