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

◆ Create< TOther >()

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

Definition at line 1049 of file Half.cs.

1050 {
1051 if (typeof(TOther) == typeof(byte))
1052 {
1053 return (Half)(int)(byte)(object)value;
1054 }
1055 if (typeof(TOther) == typeof(char))
1056 {
1057 return (Half)(int)(char)(object)value;
1058 }
1059 if (typeof(TOther) == typeof(decimal))
1060 {
1061 return (Half)(float)(decimal)(object)value;
1062 }
1063 if (typeof(TOther) == typeof(double))
1064 {
1065 return (Half)(double)(object)value;
1066 }
1067 if (typeof(TOther) == typeof(short))
1068 {
1069 return (Half)(short)(object)value;
1070 }
1071 if (typeof(TOther) == typeof(int))
1072 {
1073 return (Half)(int)(object)value;
1074 }
1075 if (typeof(TOther) == typeof(long))
1076 {
1077 return (Half)(long)(object)value;
1078 }
1079 if (typeof(TOther) == typeof(IntPtr))
1080 {
1081 return (Half)(nint)(IntPtr)(object)value;
1082 }
1083 if (typeof(TOther) == typeof(sbyte))
1084 {
1085 return (Half)(sbyte)(object)value;
1086 }
1087 if (typeof(TOther) == typeof(float))
1088 {
1089 return (Half)(float)(object)value;
1090 }
1091 if (typeof(TOther) == typeof(ushort))
1092 {
1093 return (Half)(int)(ushort)(object)value;
1094 }
1095 if (typeof(TOther) == typeof(uint))
1096 {
1097 return (Half)(uint)(object)value;
1098 }
1099 if (typeof(TOther) == typeof(ulong))
1100 {
1101 return (Half)(ulong)(object)value;
1102 }
1103 if (typeof(TOther) == typeof(UIntPtr))
1104 {
1105 return (Half)(nuint)(UIntPtr)(object)value;
1106 }
1107 ThrowHelper.ThrowNotSupportedException();
1108 return default(Half);
1109 }
Half(ushort value)
Definition Half.cs:78

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