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

◆ CreateTruncating< TOther >()

static short INumber< short >. System.Int16.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 651 of file Int16.cs.

652 {
653 if (typeof(TOther) == typeof(byte))
654 {
655 return (byte)(object)value;
656 }
657 if (typeof(TOther) == typeof(char))
658 {
659 return (short)(char)(object)value;
660 }
661 if (typeof(TOther) == typeof(decimal))
662 {
663 return (short)(decimal)(object)value;
664 }
665 if (typeof(TOther) == typeof(double))
666 {
667 return (short)(double)(object)value;
668 }
669 if (typeof(TOther) == typeof(short))
670 {
671 return (short)(object)value;
672 }
673 if (typeof(TOther) == typeof(int))
674 {
675 return (short)(int)(object)value;
676 }
677 if (typeof(TOther) == typeof(long))
678 {
679 return (short)(long)(object)value;
680 }
681 if (typeof(TOther) == typeof(IntPtr))
682 {
683 return (short)(nint)(IntPtr)(object)value;
684 }
685 if (typeof(TOther) == typeof(sbyte))
686 {
687 return (sbyte)(object)value;
688 }
689 if (typeof(TOther) == typeof(float))
690 {
691 return (short)(float)(object)value;
692 }
693 if (typeof(TOther) == typeof(ushort))
694 {
695 return (short)(ushort)(object)value;
696 }
697 if (typeof(TOther) == typeof(uint))
698 {
699 return (short)(uint)(object)value;
700 }
701 if (typeof(TOther) == typeof(ulong))
702 {
703 return (short)(ulong)(object)value;
704 }
705 if (typeof(TOther) == typeof(UIntPtr))
706 {
707 return (short)(nuint)(UIntPtr)(object)value;
708 }
709 ThrowHelper.ThrowNotSupportedException();
710 return 0;
711 }

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