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

◆ CreateTruncating< TOther >()

static byte INumber< byte >. System.Byte.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 658 of file Byte.cs.

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

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