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