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

◆ CreateTruncating< TOther >()

static nuint INumber< UIntPtr >. System.UIntPtr.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 663 of file UIntPtr.cs.

664 {
665 if (typeof(TOther) == typeof(byte))
666 {
667 return (byte)(object)value;
668 }
669 if (typeof(TOther) == typeof(char))
670 {
671 return (char)(object)value;
672 }
673 if (typeof(TOther) == typeof(decimal))
674 {
675 return (nuint)(ulong)(decimal)(object)value;
676 }
677 if (typeof(TOther) == typeof(double))
678 {
679 return (nuint)(double)(object)value;
680 }
681 if (typeof(TOther) == typeof(short))
682 {
683 return (nuint)(short)(object)value;
684 }
685 if (typeof(TOther) == typeof(int))
686 {
687 return (nuint)(int)(object)value;
688 }
689 if (typeof(TOther) == typeof(long))
690 {
691 return (nuint)(long)(object)value;
692 }
693 if (typeof(TOther) == typeof(IntPtr))
694 {
695 return (nuint)(nint)(IntPtr)(object)value;
696 }
697 if (typeof(TOther) == typeof(sbyte))
698 {
699 return (nuint)(sbyte)(object)value;
700 }
701 if (typeof(TOther) == typeof(float))
702 {
703 return (nuint)(float)(object)value;
704 }
705 if (typeof(TOther) == typeof(ushort))
706 {
707 return (ushort)(object)value;
708 }
709 if (typeof(TOther) == typeof(uint))
710 {
711 return (uint)(object)value;
712 }
713 if (typeof(TOther) == typeof(ulong))
714 {
715 return (nuint)(ulong)(object)value;
716 }
717 if (typeof(TOther) == typeof(UIntPtr))
718 {
719 return (UIntPtr)(object)value;
720 }
721 ThrowHelper.ThrowNotSupportedException();
722 return 0u;
723 }
unsafe UIntPtr(uint value)
Definition UIntPtr.cs:67

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