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

◆ CreateSaturating< TOther >()

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

Definition at line 3237 of file Decimal.cs.

3238 {
3239 if (typeof(TOther) == typeof(byte))
3240 {
3241 return (byte)(object)value;
3242 }
3243 if (typeof(TOther) == typeof(char))
3244 {
3245 return (char)(object)value;
3246 }
3247 if (typeof(TOther) == typeof(decimal))
3248 {
3249 return (decimal)(object)value;
3250 }
3251 if (typeof(TOther) == typeof(double))
3252 {
3253 return (decimal)(double)(object)value;
3254 }
3255 if (typeof(TOther) == typeof(short))
3256 {
3257 return (short)(object)value;
3258 }
3259 if (typeof(TOther) == typeof(int))
3260 {
3261 return (int)(object)value;
3262 }
3263 if (typeof(TOther) == typeof(long))
3264 {
3265 return (long)(object)value;
3266 }
3267 if (typeof(TOther) == typeof(IntPtr))
3268 {
3269 return (long)(IntPtr)(object)value;
3270 }
3271 if (typeof(TOther) == typeof(sbyte))
3272 {
3273 return (sbyte)(object)value;
3274 }
3275 if (typeof(TOther) == typeof(float))
3276 {
3277 return (decimal)(float)(object)value;
3278 }
3279 if (typeof(TOther) == typeof(ushort))
3280 {
3281 return (ushort)(object)value;
3282 }
3283 if (typeof(TOther) == typeof(uint))
3284 {
3285 return (uint)(object)value;
3286 }
3287 if (typeof(TOther) == typeof(ulong))
3288 {
3289 return (ulong)(object)value;
3290 }
3291 if (typeof(TOther) == typeof(UIntPtr))
3292 {
3293 return (ulong)(UIntPtr)(object)value;
3294 }
3295 ThrowHelper.ThrowNotSupportedException();
3296 return 0m;
3297 }

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