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

◆ Create< TOther >()

static uint INumber< uint >. System.UInt32.Create< TOther > ( TOther value)
inlinestatic

Definition at line 425 of file UInt32.cs.

426 {
427 if (typeof(TOther) == typeof(byte))
428 {
429 return (byte)(object)value;
430 }
431 if (typeof(TOther) == typeof(char))
432 {
433 return (char)(object)value;
434 }
435 if (typeof(TOther) == typeof(decimal))
436 {
437 return (uint)(decimal)(object)value;
438 }
439 checked
440 {
441 if (typeof(TOther) == typeof(double))
442 {
443 return (uint)(double)(object)value;
444 }
445 if (typeof(TOther) == typeof(short))
446 {
447 return (uint)(short)(object)value;
448 }
449 if (typeof(TOther) == typeof(int))
450 {
451 return (uint)(int)(object)value;
452 }
453 if (typeof(TOther) == typeof(long))
454 {
455 return (uint)(long)(object)value;
456 }
457 if (typeof(TOther) == typeof(IntPtr))
458 {
459 return (uint)(nint)(IntPtr)(object)value;
460 }
461 if (typeof(TOther) == typeof(sbyte))
462 {
463 return (uint)(sbyte)(object)value;
464 }
465 if (typeof(TOther) == typeof(float))
466 {
467 return (uint)(float)(object)value;
468 }
469 if (typeof(TOther) == typeof(ushort))
470 {
471 return (ushort)(object)value;
472 }
473 if (typeof(TOther) == typeof(uint))
474 {
475 return (uint)(object)value;
476 }
477 if (typeof(TOther) == typeof(ulong))
478 {
479 return (uint)(ulong)(object)value;
480 }
481 if (typeof(TOther) == typeof(UIntPtr))
482 {
483 return (uint)(UIntPtr)(object)value;
484 }
485 ThrowHelper.ThrowNotSupportedException();
486 return 0u;
487 }
488 }

References System.ThrowHelper.ThrowNotSupportedException(), and System.value.