/// <summary> /// Gets an override object from a given id. Returns null if none found. /// </summary> /// <param name="id">The id the override object.</param> /// <returns></returns> public T?GetOverride(string id) { if (id is null) { throw new ArgumentNullException(nameof(id)); } if (DataOverridesById == null) { throw new NullReferenceException("The Load() method needs to be called before this method can be used."); } if (id.Contains(".stormmod", StringComparison.OrdinalIgnoreCase)) { id = id.Replace(".stormmod", string.Empty, StringComparison.OrdinalIgnoreCase); } if (DataOverridesById.TryGetValue(id, out T? overrideData)) { return(overrideData); } else { return(null); } }
/// <summary> /// Gets an override object from a given id. Returns null if none found. /// </summary> /// <param name="id">The id the override object.</param> /// <returns></returns> public T GetOverride(string id) { if (DataOverridesById == null) { throw new NullReferenceException("The Load() method needs to be called before this method can be used."); } if (id.Contains(".stormmod")) { id = id.Replace(".stormmod", string.Empty); } if (DataOverridesById.TryGetValue(id, out T overrideData)) { return(overrideData); } else { return(null); } }