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

◆ Create< TOther >()

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

Definition at line 472 of file UIntPtr.cs.

473 {
474 if (typeof(TOther) == typeof(byte))
475 {
476 return (byte)(object)value;
477 }
478 if (typeof(TOther) == typeof(char))
479 {
480 return (char)(object)value;
481 }
482 checked
483 {
484 if (typeof(TOther) == typeof(decimal))
485 {
486 return (nuint)(ulong)(decimal)(object)value;
487 }
488 if (typeof(TOther) == typeof(double))
489 {
490 return (nuint)(double)(object)value;
491 }
492 if (typeof(TOther) == typeof(short))
493 {
494 return (nuint)(short)(object)value;
495 }
496 if (typeof(TOther) == typeof(int))
497 {
498 return (nuint)(int)(object)value;
499 }
500 if (typeof(TOther) == typeof(long))
501 {
502 return (nuint)(long)(object)value;
503 }
504 if (typeof(TOther) == typeof(IntPtr))
505 {
506 return (nuint)(nint)(IntPtr)(object)value;
507 }
508 if (typeof(TOther) == typeof(sbyte))
509 {
510 return (nuint)(sbyte)(object)value;
511 }
512 if (typeof(TOther) == typeof(float))
513 {
514 return (nuint)(float)(object)value;
515 }
516 if (typeof(TOther) == typeof(ushort))
517 {
518 return (ushort)(object)value;
519 }
520 if (typeof(TOther) == typeof(uint))
521 {
522 return (uint)(object)value;
523 }
524 if (typeof(TOther) == typeof(ulong))
525 {
526 return (nuint)(ulong)(object)value;
527 }
528 if (typeof(TOther) == typeof(UIntPtr))
529 {
530 return (UIntPtr)(object)value;
531 }
532 ThrowHelper.ThrowNotSupportedException();
533 return 0u;
534 }
535 }
unsafe UIntPtr(uint value)
Definition UIntPtr.cs:67

References System.Runtime.Serialization.Dictionary, System.ThrowHelper.ThrowNotSupportedException(), and System.value.