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

◆ Create< TOther >()

static decimal INumber< decimal >. System.Decimal.Create< TOther > ( TOther value)
inlinestatic

Definition at line 3173 of file Decimal.cs.

3174 {
3175 if (typeof(TOther) == typeof(byte))
3176 {
3177 return (byte)(object)value;
3178 }
3179 if (typeof(TOther) == typeof(char))
3180 {
3181 return (char)(object)value;
3182 }
3183 if (typeof(TOther) == typeof(decimal))
3184 {
3185 return (decimal)(object)value;
3186 }
3187 if (typeof(TOther) == typeof(double))
3188 {
3189 return (decimal)(double)(object)value;
3190 }
3191 if (typeof(TOther) == typeof(short))
3192 {
3193 return (short)(object)value;
3194 }
3195 if (typeof(TOther) == typeof(int))
3196 {
3197 return (int)(object)value;
3198 }
3199 if (typeof(TOther) == typeof(long))
3200 {
3201 return (long)(object)value;
3202 }
3203 if (typeof(TOther) == typeof(IntPtr))
3204 {
3205 return (long)(IntPtr)(object)value;
3206 }
3207 if (typeof(TOther) == typeof(sbyte))
3208 {
3209 return (sbyte)(object)value;
3210 }
3211 if (typeof(TOther) == typeof(float))
3212 {
3213 return (decimal)(float)(object)value;
3214 }
3215 if (typeof(TOther) == typeof(ushort))
3216 {
3217 return (ushort)(object)value;
3218 }
3219 if (typeof(TOther) == typeof(uint))
3220 {
3221 return (uint)(object)value;
3222 }
3223 if (typeof(TOther) == typeof(ulong))
3224 {
3225 return (ulong)(object)value;
3226 }
3227 if (typeof(TOther) == typeof(UIntPtr))
3228 {
3229 return (ulong)(UIntPtr)(object)value;
3230 }
3231 ThrowHelper.ThrowNotSupportedException();
3232 return 0m;
3233 }

References System.Runtime.Serialization.Dictionary, System.ThrowHelper.ThrowNotSupportedException(), and System.value.