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

◆ Create< TOther >()

static char INumber< char >. System.Char.Create< TOther > ( TOther value)
inlinestatic

Definition at line 984 of file Char.cs.

985 {
986 if (typeof(TOther) == typeof(byte))
987 {
988 return (char)(byte)(object)value;
989 }
990 if (typeof(TOther) == typeof(char))
991 {
992 return (char)(object)value;
993 }
994 if (typeof(TOther) == typeof(decimal))
995 {
996 return (char)(decimal)(object)value;
997 }
998 if (typeof(TOther) == typeof(double))
999 {
1000 return (char)checked((ushort)(double)(object)value);
1001 }
1002 if (typeof(TOther) == typeof(short))
1003 {
1004 return (char)checked((ushort)(short)(object)value);
1005 }
1006 if (typeof(TOther) == typeof(int))
1007 {
1008 return (char)checked((ushort)(int)(object)value);
1009 }
1010 if (typeof(TOther) == typeof(long))
1011 {
1012 return (char)checked((ushort)(long)(object)value);
1013 }
1014 if (typeof(TOther) == typeof(IntPtr))
1015 {
1016 return (char)checked((ushort)(nint)(IntPtr)(object)value);
1017 }
1018 if (typeof(TOther) == typeof(sbyte))
1019 {
1020 return (char)checked((ushort)(sbyte)(object)value);
1021 }
1022 if (typeof(TOther) == typeof(float))
1023 {
1024 return (char)checked((ushort)(float)(object)value);
1025 }
1026 if (typeof(TOther) == typeof(ushort))
1027 {
1028 return (char)(ushort)(object)value;
1029 }
1030 if (typeof(TOther) == typeof(uint))
1031 {
1032 return (char)checked((ushort)(uint)(object)value);
1033 }
1034 if (typeof(TOther) == typeof(ulong))
1035 {
1036 return (char)checked((ushort)(ulong)(object)value);
1037 }
1038 if (typeof(TOther) == typeof(UIntPtr))
1039 {
1040 return (char)checked((ushort)(nuint)(UIntPtr)(object)value);
1041 }
1042 ThrowHelper.ThrowNotSupportedException();
1043 return '\0';
1044 }

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