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

◆ CreateTruncating< TOther >()

static sbyte INumber< sbyte >. System.SByte.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 666 of file SByte.cs.

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

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