Anvil
Anvil.API.IntegerExtensions Class Reference

Static Public Member Functions

static byte AsByte (this sbyte value)
 Reinterprets the specified value as an unsigned byte. More...
 
static int AsInt (this uint value)
 Reinterprets the specified value as an int. More...
 
static long AsLong (this ulong value)
 Reinterprets the specified value as a long. More...
 
static sbyte AsSByte (this byte value)
 Reinterprets the specified value as a signed byte. More...
 
static short AsShort (this ushort value)
 Reinterprets the specified value as a signed short. More...
 
static uint AsUInt (this int value)
 Reinterprets the specified value as an unsigned int. More...
 
static ulong AsULong (this long value)
 Reinterprets the specified value as an unsigned long. More...
 
static ushort AsUShort (this short value)
 Reinterprets the specified value as an unsigned short. More...
 
static bool ToBool (this int value)
 Reinterprets the specified value as a boolean. More...
 
static int ToInt (this bool value)
 Reinterprets the specified value as a integer. More...
 
static ? NwObject ToNwObject (this uint objectId)
 Converts the specified object ID value into a managed game object. More...
 
static ? T ToNwObject< T > (this uint objectId)
 Converts the specified object ID value into a managed game object. More...
 
static ? T ToNwObjectSafe< T > (this uint objectId)
 Converts the specified object ID value into a managed game object. More...
 
static unsafe? NwPlayer ToNwPlayer (this uint objectId, PlayerSearch playerSearch=PlayerSearch.All)
 Converts the specified object ID value into a managed player object. More...
 

Member Function Documentation

◆ AsByte()

static byte Anvil.API.IntegerExtensions.AsByte ( this sbyte  value)
inlinestatic

Reinterprets the specified value as an unsigned byte.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ AsInt()

static int Anvil.API.IntegerExtensions.AsInt ( this uint  value)
inlinestatic

Reinterprets the specified value as an int.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ AsLong()

static long Anvil.API.IntegerExtensions.AsLong ( this ulong  value)
inlinestatic

Reinterprets the specified value as a long.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ AsSByte()

static sbyte Anvil.API.IntegerExtensions.AsSByte ( this byte  value)
inlinestatic

Reinterprets the specified value as a signed byte.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ AsShort()

static short Anvil.API.IntegerExtensions.AsShort ( this ushort  value)
inlinestatic

Reinterprets the specified value as a signed short.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ AsUInt()

static uint Anvil.API.IntegerExtensions.AsUInt ( this int  value)
inlinestatic

Reinterprets the specified value as an unsigned int.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ AsULong()

static ulong Anvil.API.IntegerExtensions.AsULong ( this long  value)
inlinestatic

Reinterprets the specified value as an unsigned long.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ AsUShort()

static ushort Anvil.API.IntegerExtensions.AsUShort ( this short  value)
inlinestatic

Reinterprets the specified value as an unsigned short.

Parameters
valueThe value to reinterpret.
Returns
The reinterpreted value.

◆ ToBool()

static bool Anvil.API.IntegerExtensions.ToBool ( this int  value)
inlinestatic

Reinterprets the specified value as a boolean.

Parameters
valueThe value to reinterpret.
Returns
False if the value is 0, true for any non-0 value.

◆ ToInt()

static int Anvil.API.IntegerExtensions.ToInt ( this bool  value)
inlinestatic

Reinterprets the specified value as a integer.

Parameters
valueThe value to reinterpret.
Returns
1 if true, 0 if false.

◆ ToNwObject()

static ? NwObject Anvil.API.IntegerExtensions.ToNwObject ( this uint  objectId)
inlinestatic

Converts the specified object ID value into a managed game object.

Parameters
objectIdThe object ID to convert.
Returns
The associated object if it exists, otherwise null.

◆ ToNwObject< T >()

static ? T Anvil.API.IntegerExtensions.ToNwObject< T > ( this uint  objectId)
inlinestatic

Converts the specified object ID value into a managed game object.

Parameters
objectIdThe object ID to convert.
Template Parameters
TThe expected object type.
Returns
The associated object if it exists, otherwise null.
Exceptions
InvalidCastExceptionThrown if the object associated with the object ID is not of type T.
Type Constraints
T :NwObject 

◆ ToNwObjectSafe< T >()

static ? T Anvil.API.IntegerExtensions.ToNwObjectSafe< T > ( this uint  objectId)
inlinestatic

Converts the specified object ID value into a managed game object.

Parameters
objectIdThe object ID to convert.
Template Parameters
TThe expected object type.
Returns
The associated object if it exists and is of type T, otherwise null.
Type Constraints
T :NwObject 

◆ ToNwPlayer()

static unsafe? NwPlayer Anvil.API.IntegerExtensions.ToNwPlayer ( this uint  objectId,
PlayerSearch  playerSearch = PlayerSearch.All 
)
inlinestatic

Converts the specified object ID value into a managed player object.

Parameters
objectIdThe object ID to convert.
playerSearchMethods to use to resolve the player.
Returns
The associated player for this object, otherwise null.

The documentation for this class was generated from the following file: