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