/// <summary> /// Converts the specified object ID value into a managed game object. /// </summary> /// <param name="objectId">The object ID to convert.</param> /// <typeparam name="T">The expected object type.</typeparam> /// <returns>The associated object if it exists and is of type T, otherwise null.</returns> public static T?ToNwObjectSafe <T>(this uint objectId) where T : NwObject { return(NwObject.CreateInternal(objectId) as T); }
/// <summary> /// Converts the specified object ID value into a managed game object. /// </summary> /// <param name="objectId">The object ID to convert.</param> /// <typeparam name="T">The expected object type.</typeparam> /// <returns>The associated object if it exists, otherwise null.</returns> /// <exception cref="InvalidCastException">Thrown if the object associated with the object ID is not of type T.</exception> public static T?ToNwObject <T>(this uint objectId) where T : NwObject { return((T?)NwObject.CreateInternal(objectId)); }
/// <summary> /// Converts the specified object ID value into a managed game object. /// </summary> /// <param name="objectId">The object ID to convert.</param> /// <returns>The associated object if it exists, otherwise null.</returns> public static NwObject?ToNwObject(this uint objectId) { return(NwObject.CreateInternal(objectId)); }
public static NwObject?ToNwObject(this ICGameObject gameObject) { return(NwObject.CreateInternal(gameObject)); }
public static T?ToNwObjectSafe <T>(this ICGameObject gameObject) where T : NwObject { return(NwObject.CreateInternal(gameObject) as T); }
public static T?ToNwObject <T>(this ICGameObject gameObject) where T : NwObject { return((T?)NwObject.CreateInternal(gameObject)); }
public static InternalVariableEnum <VisibilityMode> PlayerVisibilityOverride(NwPlayer player, NwObject targetGameObject) => player.ControlledCreature !.GetObjectVariable <InternalVariableEnum <VisibilityMode> >("VISIBILITY_OVERRIDE" + targetGameObject.ObjectId);
public static InternalVariableEnum <VisibilityMode> GlobalVisibilityOverride(NwObject gameObject) => gameObject.GetObjectVariable <InternalVariableEnum <VisibilityMode> >("VISIBILITY_OVERRIDE");
public static InternalVariableBool AlwaysWalk(NwObject creature) => creature.GetObjectVariable <InternalVariableBool>("ALWAYS_WALK");
/// <summary> /// Binds the specified parameter with the specified value. /// </summary> /// <param name="param">The parameter name to bind.</param> /// <param name="value">The value to bind to the parameter.</param> public void BindParam(string param, NwObject value) { AssertQueryExecuted(false); NWScript.SqlBindObject(this, param, value); }