string ILocalVariableConverter <string> .GetLocal(NwObject nwObject, string name) => NWScript.GetLocalString(nwObject, name);
NwObject ILocalVariableConverter <NwObject> .GetLocal(NwObject nwObject, string name) => NWScript.GetLocalObject(nwObject, name).ToNwObject();
void ILocalVariableConverter <NwObject> .SetLocal(NwObject nwObject, string name, NwObject value) => NWScript.SetLocalObject(nwObject, name, value);
public static NwStore Create(string template, Location location, bool useAppearAnim = false, string newTag = "") { return(NwObject.CreateInternal <NwStore>(template, location, useAppearAnim, newTag)); }
void ILocalVariableConverter <Location> .ClearLocal(NwObject nwObject, string name) => NWScript.DeleteLocalLocation(nwObject, name);
Guid ILocalVariableConverter <Guid> .GetLocal(NwObject nwObject, string name) { string stored = NWScript.GetLocalString(nwObject, name); return(string.IsNullOrEmpty(stored) ? Guid.Empty : Guid.Parse(stored)); }
void ILocalVariableConverter <Guid> .ClearLocal(NwObject nwObject, string name) => NWScript.DeleteLocalString(nwObject, name);
void ILocalVariableConverter <float> .SetLocal(NwObject nwObject, string name, float value) => NWScript.SetLocalFloat(nwObject, name, value);
void ILocalVariableConverter <float> .ClearLocal(NwObject nwObject, string name) => NWScript.DeleteLocalFloat(nwObject, name);
void ILocalVariableConverter <string> .SetLocal(NwObject nwObject, string name, string value) => NWScript.SetLocalString(nwObject, name, value);
float ILocalVariableConverter <float> .GetLocal(NwObject nwObject, string name) => NWScript.GetLocalFloat(nwObject, name);
/// <summary> /// Attempts to resolve a living active game object from the specified UUID. /// </summary> /// <param name="objectId">The UUID of the object.</param> /// <returns>The game object with the given UUID, otherwise returns null if it does not exist.</returns> public static NwObject ToNwObject(this Guid objectId) { return(NwObject.CreateInternal(objectId)); }
/// <summary> /// Attempts to resolve a living active game object from the specified UUID. /// </summary> /// <param name="objectId">The UUID of the object.</param> /// <typeparam name="T">The expected object type.</typeparam> /// <returns>The game object with the given UUID, otherwise returns null if it does not exist.</returns> /// <exception cref="InvalidCastException">Object is not type T. See <see cref="ToNwObjectSafe{T}"/> if null should be returned in this case.</exception> public static T ToNwObject <T>(this Guid objectId) where T : NwObject { return((T)NwObject.CreateInternal(objectId)); }
/// <summary> /// Attempts to resolve a living active game object from the specified UUID. /// </summary> /// <param name="objectId">The UUID of the object.</param> /// <typeparam name="T">The expected object type. If the object is not this type.</typeparam> /// <returns>The game object with the given UUID and the specified type, otherwise returns null.</returns> public static T ToNwObjectSafe <T>(this Guid objectId) where T : NwObject { return(NwObject.CreateInternal(objectId) as T); }
void ILocalVariableConverter <bool> .SetLocal(NwObject nwObject, string name, bool value) => NWScript.SetLocalInt(nwObject, name, value.ToInt());
int ILocalVariableConverter <int> .GetLocal(NwObject nwObject, string name) => NWScript.GetLocalInt(nwObject, name);
void ILocalVariableConverter <bool> .ClearLocal(NwObject nwObject, string name) => NWScript.DeleteLocalInt(nwObject, name);
Location ILocalVariableConverter <Location> .GetLocal(NwObject nwObject, string name) => NWScript.GetLocalLocation(nwObject, name);
void ILocalVariableConverter <Guid> .SetLocal(NwObject nwObject, string name, Guid value) => NWScript.SetLocalString(nwObject, name, value.ToUUIDString());
void ILocalVariableConverter <Location> .SetLocal(NwObject nwObject, string name, Location value) => NWScript.SetLocalLocation(nwObject, name, value);
bool ILocalVariableConverter <bool> .GetLocal(NwObject nwObject, string name) => NWScript.GetLocalInt(nwObject, name).ToBool();
/// <summary> /// Executes the specified NWN script. /// If scriptName does not specify a compiled script, nothing happens. /// </summary> public static void Execute(string scriptName, NwObject target, params (string ParamName, string ParamValue)[] scriptParams)