Exemple #1
0
 /// <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);
 }
Exemple #2
0
 /// <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));
 }
Exemple #3
0
 /// <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));
 }
Exemple #4
0
 public static NwObject?ToNwObject(this ICGameObject gameObject)
 {
     return(NwObject.CreateInternal(gameObject));
 }
Exemple #5
0
 public static T?ToNwObjectSafe <T>(this ICGameObject gameObject) where T : NwObject
 {
     return(NwObject.CreateInternal(gameObject) as T);
 }
Exemple #6
0
 public static T?ToNwObject <T>(this ICGameObject gameObject) where T : NwObject
 {
     return((T?)NwObject.CreateInternal(gameObject));
 }
Exemple #7
0
 public static InternalVariableEnum <VisibilityMode> PlayerVisibilityOverride(NwPlayer player, NwObject targetGameObject) => player.ControlledCreature !.GetObjectVariable <InternalVariableEnum <VisibilityMode> >("VISIBILITY_OVERRIDE" + targetGameObject.ObjectId);
Exemple #8
0
 public static InternalVariableEnum <VisibilityMode> GlobalVisibilityOverride(NwObject gameObject) => gameObject.GetObjectVariable <InternalVariableEnum <VisibilityMode> >("VISIBILITY_OVERRIDE");
Exemple #9
0
 public static InternalVariableBool AlwaysWalk(NwObject creature) => creature.GetObjectVariable <InternalVariableBool>("ALWAYS_WALK");
Exemple #10
0
 /// <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);
 }