Example #1
0
 string ILocalVariableConverter <string> .GetLocal(NwObject nwObject, string name)
 => NWScript.GetLocalString(nwObject, name);
Example #2
0
 NwObject ILocalVariableConverter <NwObject> .GetLocal(NwObject nwObject, string name)
 => NWScript.GetLocalObject(nwObject, name).ToNwObject();
Example #3
0
 void ILocalVariableConverter <NwObject> .SetLocal(NwObject nwObject, string name, NwObject value)
 => NWScript.SetLocalObject(nwObject, name, value);
Example #4
0
 public static NwStore Create(string template, Location location, bool useAppearAnim = false, string newTag = "")
 {
     return(NwObject.CreateInternal <NwStore>(template, location, useAppearAnim, newTag));
 }
Example #5
0
 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);
Example #8
0
 void ILocalVariableConverter <float> .SetLocal(NwObject nwObject, string name, float value)
 => NWScript.SetLocalFloat(nwObject, name, value);
Example #9
0
 void ILocalVariableConverter <float> .ClearLocal(NwObject nwObject, string name)
 => NWScript.DeleteLocalFloat(nwObject, name);
Example #10
0
 void ILocalVariableConverter <string> .SetLocal(NwObject nwObject, string name, string value)
 => NWScript.SetLocalString(nwObject, name, value);
Example #11
0
 float ILocalVariableConverter <float> .GetLocal(NwObject nwObject, string name)
 => NWScript.GetLocalFloat(nwObject, name);
Example #12
0
 /// <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));
 }
Example #13
0
 /// <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));
 }
Example #14
0
 /// <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());
Example #16
0
 int ILocalVariableConverter <int> .GetLocal(NwObject nwObject, string name)
 => NWScript.GetLocalInt(nwObject, name);
 void ILocalVariableConverter <bool> .ClearLocal(NwObject nwObject, string name)
 => NWScript.DeleteLocalInt(nwObject, name);
Example #18
0
 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());
Example #20
0
 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();
Example #22
0
 /// <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)