/// <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)); }
/// <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); }
/// <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)); }
public static NwStore Create(string template, Location location, bool useAppearAnim = false, string newTag = "") { return(NwObject.CreateInternal <NwStore>(template, location, useAppearAnim, newTag)); }