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

◆ Create< TOther >()

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

Definition at line 483 of file IntPtr.cs.

484 {
485 if (typeof(TOther) == typeof(byte))
486 {
487 return (byte)(object)value;
488 }
489 if (typeof(TOther) == typeof(char))
490 {
491 return (char)(object)value;
492 }
493 checked
494 {
495 if (typeof(TOther) == typeof(decimal))
496 {
497 return (nint)(long)(decimal)(object)value;
498 }
499 if (typeof(TOther) == typeof(double))
500 {
501 return (nint)(double)(object)value;
502 }
503 if (typeof(TOther) == typeof(short))
504 {
505 return (short)(object)value;
506 }
507 if (typeof(TOther) == typeof(int))
508 {
509 return (int)(object)value;
510 }
511 if (typeof(TOther) == typeof(long))
512 {
513 return (nint)(long)(object)value;
514 }
515 if (typeof(TOther) == typeof(IntPtr))
516 {
517 return (IntPtr)(object)value;
518 }
519 if (typeof(TOther) == typeof(sbyte))
520 {
521 return (sbyte)(object)value;
522 }
523 if (typeof(TOther) == typeof(float))
524 {
525 return (nint)(float)(object)value;
526 }
527 if (typeof(TOther) == typeof(ushort))
528 {
529 return (ushort)(object)value;
530 }
531 if (typeof(TOther) == typeof(uint))
532 {
533 return (nint)(uint)(object)value;
534 }
535 if (typeof(TOther) == typeof(ulong))
536 {
537 return (nint)(ulong)(object)value;
538 }
539 if (typeof(TOther) == typeof(UIntPtr))
540 {
541 return (nint)(nuint)(UIntPtr)(object)value;
542 }
543 ThrowHelper.ThrowNotSupportedException();
544 return 0;
545 }
546 }
unsafe IntPtr(int value)
Definition IntPtr.cs:69

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