Anvil
Anvil.API.GuidExtensions Class Reference

GUID/UUID extension methods for resolving game objects, and GUID serialisation. More...

Static Public Member Functions

static ? NwObject ToNwObject (this Guid objectId)
 Attempts to resolve a living active game object from the specified UUID. More...
 
static ? T ToNwObject< T > (this Guid objectId)
 Attempts to resolve a living active game object from the specified UUID. More...
 
static ? T ToNwObjectSafe< T > (this Guid objectId)
 Attempts to resolve a living active game object from the specified UUID. More...
 
static string ToUUIDString (this Guid guid)
 Converts this GUID instance to a native compatible UUID string. More...
 

Detailed Description

GUID/UUID extension methods for resolving game objects, and GUID serialisation.

Member Function Documentation

◆ ToNwObject()

static ? NwObject Anvil.API.GuidExtensions.ToNwObject ( this Guid  objectId)
inlinestatic

Attempts to resolve a living active game object from the specified UUID.

Parameters
objectIdThe UUID of the object.
Returns
The game object with the given UUID, otherwise returns null if it does not exist.

◆ ToNwObject< T >()

static ? T Anvil.API.GuidExtensions.ToNwObject< T > ( this Guid  objectId)
inlinestatic

Attempts to resolve a living active game object from the specified UUID.

Parameters
objectIdThe UUID of the object.
Template Parameters
TThe expected object type.
Returns
The game object with the given UUID, otherwise returns null if it does not exist.
Exceptions
InvalidCastExceptionObject is not type T. See ToNwObjectSafe<T> if null should be returned in this case.
Type Constraints
T :NwObject 

◆ ToNwObjectSafe< T >()

static ? T Anvil.API.GuidExtensions.ToNwObjectSafe< T > ( this Guid  objectId)
inlinestatic

Attempts to resolve a living active game object from the specified UUID.

Parameters
objectIdThe UUID of the object.
Template Parameters
TThe expected object type. If the object is not this type.
Returns
The game object with the given UUID and the specified type, otherwise returns null.
Type Constraints
T :NwObject 

◆ ToUUIDString()

static string Anvil.API.GuidExtensions.ToUUIDString ( this Guid  guid)
inlinestatic

Converts this GUID instance to a native compatible UUID string.

Parameters
guidThe GUID instance to convert.
Returns
The hyphenated UUID string, matching NWN's formatting.

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