Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ StoreLocal()

void System.Reflection.Metadata.Ecma335.InstructionEncoder.StoreLocal ( int slotIndex)
inline

Definition at line 185 of file InstructionEncoder.cs.

186 {
187 switch (slotIndex)
188 {
189 case 0:
190 OpCode(ILOpCode.Stloc_0);
191 return;
192 case 1:
193 OpCode(ILOpCode.Stloc_1);
194 return;
195 case 2:
196 OpCode(ILOpCode.Stloc_2);
197 return;
198 case 3:
199 OpCode(ILOpCode.Stloc_3);
200 return;
201 }
202 if ((uint)slotIndex <= 255u)
203 {
204 OpCode(ILOpCode.Stloc_s);
205 CodeBuilder.WriteByte((byte)slotIndex);
206 }
207 else if (slotIndex > 0)
208 {
209 OpCode(ILOpCode.Stloc);
210 CodeBuilder.WriteInt32(slotIndex);
211 }
212 else
213 {
214 Throw.ArgumentOutOfRange("slotIndex");
215 }
216 }

References System.Reflection.Throw.ArgumentOutOfRange(), System.Reflection.Metadata.Ecma335.InstructionEncoder.CodeBuilder, System.Reflection.Metadata.Ecma335.InstructionEncoder.OpCode(), System.Reflection.Metadata.BlobBuilder.WriteByte(), and System.Reflection.Metadata.BlobBuilder.WriteInt32().