Example #1
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));
 }
Example #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));
 }
Example #3
0
 public static T?ToNwObjectSafe <T>(this ICGameObject gameObject) where T : NwObject
 {
     return(NwObject.CreateInternal(gameObject) as T);
 }
Example #4
0
 public static NwObject?ToNwObject(this ICGameObject gameObject)
 {
     return(NwObject.CreateInternal(gameObject));
 }
Example #5
0
 public static T?ToNwObject <T>(this ICGameObject gameObject) where T : NwObject
 {
     return((T?)NwObject.CreateInternal(gameObject));
 }
Example #6
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);
 }