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

◆ CreateTruncating< TOther >()

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

Definition at line 626 of file UInt32.cs.

627 {
628 if (typeof(TOther) == typeof(byte))
629 {
630 return (byte)(object)value;
631 }
632 if (typeof(TOther) == typeof(char))
633 {
634 return (char)(object)value;
635 }
636 if (typeof(TOther) == typeof(decimal))
637 {
638 return (uint)(decimal)(object)value;
639 }
640 if (typeof(TOther) == typeof(double))
641 {
642 return (uint)(double)(object)value;
643 }
644 if (typeof(TOther) == typeof(short))
645 {
646 return (uint)(short)(object)value;
647 }
648 if (typeof(TOther) == typeof(int))
649 {
650 return (uint)(int)(object)value;
651 }
652 if (typeof(TOther) == typeof(long))
653 {
654 return (uint)(long)(object)value;
655 }
656 if (typeof(TOther) == typeof(IntPtr))
657 {
658 return (uint)(nint)(IntPtr)(object)value;
659 }
660 if (typeof(TOther) == typeof(sbyte))
661 {
662 return (uint)(sbyte)(object)value;
663 }
664 if (typeof(TOther) == typeof(float))
665 {
666 return (uint)(float)(object)value;
667 }
668 if (typeof(TOther) == typeof(ushort))
669 {
670 return (ushort)(object)value;
671 }
672 if (typeof(TOther) == typeof(uint))
673 {
674 return (uint)(object)value;
675 }
676 if (typeof(TOther) == typeof(ulong))
677 {
678 return (uint)(ulong)(object)value;
679 }
680 if (typeof(TOther) == typeof(UIntPtr))
681 {
682 return (uint)(nuint)(UIntPtr)(object)value;
683 }
684 ThrowHelper.ThrowNotSupportedException();
685 return 0u;
686 }

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