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

◆ Create< TOther >()

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

Definition at line 441 of file Int16.cs.

442 {
443 if (typeof(TOther) == typeof(byte))
444 {
445 return (byte)(object)value;
446 }
447 checked
448 {
449 if (typeof(TOther) == typeof(char))
450 {
451 return (short)(char)(object)value;
452 }
453 if (typeof(TOther) == typeof(decimal))
454 {
455 return (short)(decimal)(object)value;
456 }
457 if (typeof(TOther) == typeof(double))
458 {
459 return (short)(double)(object)value;
460 }
461 if (typeof(TOther) == typeof(short))
462 {
463 return (short)(object)value;
464 }
465 if (typeof(TOther) == typeof(int))
466 {
467 return (short)(int)(object)value;
468 }
469 if (typeof(TOther) == typeof(long))
470 {
471 return (short)(long)(object)value;
472 }
473 if (typeof(TOther) == typeof(IntPtr))
474 {
475 return (short)(nint)(IntPtr)(object)value;
476 }
477 if (typeof(TOther) == typeof(sbyte))
478 {
479 return (sbyte)(object)value;
480 }
481 if (typeof(TOther) == typeof(float))
482 {
483 return (short)(float)(object)value;
484 }
485 if (typeof(TOther) == typeof(ushort))
486 {
487 return (short)(ushort)(object)value;
488 }
489 if (typeof(TOther) == typeof(uint))
490 {
491 return (short)(uint)(object)value;
492 }
493 if (typeof(TOther) == typeof(ulong))
494 {
495 return (short)(ulong)(object)value;
496 }
497 if (typeof(TOther) == typeof(UIntPtr))
498 {
499 return (short)(nuint)(UIntPtr)(object)value;
500 }
501 ThrowHelper.ThrowNotSupportedException();
502 return 0;
503 }
504 }

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