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

◆ Create< TOther >()

static long INumber< long >. System.Int64.Create< TOther > ( TOther value)
inlinestatic

Definition at line 431 of file Int64.cs.

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

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