Table of Contents

Method TryParseObject

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

TryParseObject(string, out NwObject?)

Tries to resolve the specified GameObject ID string to an object. A return value indicates whether the conversion succeeded or failed.
This is the temporary ID created from ToString(). See ToNwObject(Guid) to parse persistent UUIDs.

public static bool TryParseObject(this string objectIdString, out NwObject? result)

Parameters

objectIdString string

The object ID string to parse.

result NwObject

When this method returns, contains the object referenced by the number contained in objectIdString, if the conversion succeeded, or null if the conversion failed. The conversion fails if the s parameter is null or System.String.Empty, is not in a format compliant with style, or represents an invalid object reference.

Returns

bool

true if objectIdString was converted successfully; otherwise, false.

TryParseObject<T>(string, out T?)

Tries to resolve the specified GameObject ID string to an object. A return value indicates whether the conversion succeeded or failed.
This is the temporary ID created from ToString(). See ToNwObject(Guid) to parse persistent UUIDs.

public static bool TryParseObject<T>(this string objectIdString, out T? result) where T : NwObject

Parameters

objectIdString string

The object ID string to parse.

result T

When this method returns, contains the object referenced by the number contained in objectIdString, if the conversion succeeded, or null if the conversion failed. The conversion fails if the s parameter is null or System.String.Empty, is not in a format compliant with style, or represents an invalid object reference.

Returns

bool

true if objectIdString was converted successfully; otherwise, false.

Type Parameters

T