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

◆ CreateTruncating< TOther >()

static int INumber< int >. System.Int32.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 628 of file Int32.cs.

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

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