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

◆ Create< TOther >()

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

Definition at line 442 of file SByte.cs.

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

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