GUID/UUID extension methods for resolving game objects, and GUID serialisation.
More...
|
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...
|
|
GUID/UUID extension methods for resolving game objects, and GUID serialisation.
◆ ToNwObject()
static ? NwObject Anvil.API.GuidExtensions.ToNwObject |
( |
this Guid |
objectId | ) |
|
|
inlinestatic |
Attempts to resolve a living active game object from the specified UUID.
- Parameters
-
objectId | The UUID of the object. |
- Returns
- The game object with the given UUID, otherwise returns null if it does not exist.
◆ ToNwObject< T >()
Attempts to resolve a living active game object from the specified UUID.
- Parameters
-
objectId | The UUID of the object. |
- Template Parameters
-
T | The expected object type. |
- Returns
- The game object with the given UUID, otherwise returns null if it does not exist.
- Exceptions
-
InvalidCastException | Object is not type T. See ToNwObjectSafe<T> if null should be returned in this case. |
◆ 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
-
objectId | The UUID of the object. |
- Template Parameters
-
T | The 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.
◆ ToUUIDString()
static string Anvil.API.GuidExtensions.ToUUIDString |
( |
this Guid |
guid | ) |
|
|
inlinestatic |
Converts this GUID instance to a native compatible UUID string.
- Parameters
-
guid | The GUID instance to convert. |
- Returns
- The hyphenated UUID string, matching NWN's formatting.
The documentation for this class was generated from the following file:
- NWN.Anvil/src/main/API/Extensions/GuidExtensions.cs