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

◆ Create()

static Instruction System.Linq.Expressions.Interpreter.CastInstruction.Create ( Type t)
inlinestaticinherited

Definition at line 123 of file CastInstruction.cs.

124 {
125 return t.GetTypeCode() switch
126 {
127 TypeCode.Boolean => s_Boolean ?? (s_Boolean = new CastInstructionT<bool>()),
128 TypeCode.Byte => s_Byte ?? (s_Byte = new CastInstructionT<byte>()),
129 TypeCode.Char => s_Char ?? (s_Char = new CastInstructionT<char>()),
130 TypeCode.DateTime => s_DateTime ?? (s_DateTime = new CastInstructionT<DateTime>()),
131 TypeCode.Decimal => s_Decimal ?? (s_Decimal = new CastInstructionT<decimal>()),
132 TypeCode.Double => s_Double ?? (s_Double = new CastInstructionT<double>()),
133 TypeCode.Int16 => s_Int16 ?? (s_Int16 = new CastInstructionT<short>()),
134 TypeCode.Int32 => s_Int32 ?? (s_Int32 = new CastInstructionT<int>()),
135 TypeCode.Int64 => s_Int64 ?? (s_Int64 = new CastInstructionT<long>()),
136 TypeCode.SByte => s_SByte ?? (s_SByte = new CastInstructionT<sbyte>()),
137 TypeCode.Single => s_Single ?? (s_Single = new CastInstructionT<float>()),
138 TypeCode.String => s_String ?? (s_String = new CastInstructionT<string>()),
139 TypeCode.UInt16 => s_UInt16 ?? (s_UInt16 = new CastInstructionT<ushort>()),
140 TypeCode.UInt32 => s_UInt32 ?? (s_UInt32 = new CastInstructionT<uint>()),
141 TypeCode.UInt64 => s_UInt64 ?? (s_UInt64 = new CastInstructionT<ulong>()),
142 _ => CastInstructionNoT.Create(t),
143 };
144 }

References System.Linq.Expressions.Interpreter.CastInstruction.CastInstructionNoT.Create(), System.Type.GetTypeCode(), System.Linq.Expressions.Interpreter.CastInstruction.s_Boolean, System.Linq.Expressions.Interpreter.CastInstruction.s_Byte, System.Linq.Expressions.Interpreter.CastInstruction.s_Char, System.Linq.Expressions.Interpreter.CastInstruction.s_DateTime, System.Linq.Expressions.Interpreter.CastInstruction.s_Decimal, System.Linq.Expressions.Interpreter.CastInstruction.s_Double, System.Linq.Expressions.Interpreter.CastInstruction.s_Int16, System.Linq.Expressions.Interpreter.CastInstruction.s_Int32, System.Linq.Expressions.Interpreter.CastInstruction.s_Int64, System.Linq.Expressions.Interpreter.CastInstruction.s_SByte, System.Linq.Expressions.Interpreter.CastInstruction.s_Single, System.Linq.Expressions.Interpreter.CastInstruction.s_String, System.Linq.Expressions.Interpreter.CastInstruction.s_UInt16, System.Linq.Expressions.Interpreter.CastInstruction.s_UInt32, and System.Linq.Expressions.Interpreter.CastInstruction.s_UInt64.

Referenced by System.Linq.Expressions.Interpreter.InstructionList.EmitCast().