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

◆ CreateTruncating< TOther >()

static long INumber< long >. System.Int64.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 599 of file Int64.cs.

600 {
601 if (typeof(TOther) == typeof(byte))
602 {
603 return (byte)(object)value;
604 }
605 if (typeof(TOther) == typeof(char))
606 {
607 return (char)(object)value;
608 }
609 if (typeof(TOther) == typeof(decimal))
610 {
611 return (long)(decimal)(object)value;
612 }
613 if (typeof(TOther) == typeof(double))
614 {
615 return (long)(double)(object)value;
616 }
617 if (typeof(TOther) == typeof(short))
618 {
619 return (short)(object)value;
620 }
621 if (typeof(TOther) == typeof(int))
622 {
623 return (int)(object)value;
624 }
625 if (typeof(TOther) == typeof(long))
626 {
627 return (long)(object)value;
628 }
629 if (typeof(TOther) == typeof(IntPtr))
630 {
631 return (long)(IntPtr)(object)value;
632 }
633 if (typeof(TOther) == typeof(sbyte))
634 {
635 return (sbyte)(object)value;
636 }
637 if (typeof(TOther) == typeof(float))
638 {
639 return (long)(float)(object)value;
640 }
641 if (typeof(TOther) == typeof(ushort))
642 {
643 return (ushort)(object)value;
644 }
645 if (typeof(TOther) == typeof(uint))
646 {
647 return (uint)(object)value;
648 }
649 if (typeof(TOther) == typeof(ulong))
650 {
651 return (long)(ulong)(object)value;
652 }
653 if (typeof(TOther) == typeof(UIntPtr))
654 {
655 return (long)(nuint)(UIntPtr)(object)value;
656 }
657 ThrowHelper.ThrowNotSupportedException();
658 return 0L;
659 }

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