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

◆ CreateTruncating< TOther >()

static nint INumber< IntPtr >. System.IntPtr.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 665 of file IntPtr.cs.

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

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