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

◆ Create< TOther >()

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

Definition at line 434 of file Byte.cs.

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

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