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

◆ Create< TOther >()

static ulong INumber< ulong >. System.UInt64.Create< TOther > ( TOther value)
inlinestatic

Definition at line 425 of file UInt64.cs.

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

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