/// <summary> /// Either update or add the custom list details. /// </summary> /// <param name="listName">Custom list name</param> /// <param name="newListName">Mod Id to add to list</param> public void AddModToCustomList(string listName, int modId) { var customList = CustomLists.Find(x => string.Equals(x.Name, listName, StringComparison.OrdinalIgnoreCase)); if (!customList.ModIds.Contains(modId)) { customList.ModIds.Add(modId); } }
/// <summary> /// Either update or add the custom list details. /// </summary> /// <param name="listName">Custom list name</param> /// <param name="newListName">Mod Id to add to list</param> public void UpdateCustomListName(string oldListName, string newListName) { var customList = CustomLists.Find(x => string.Equals(x.Name, oldListName, StringComparison.OrdinalIgnoreCase)); if (customList == null) { CustomLists.Add(new CustomList() { Name = newListName }); } else { CustomLists[CustomLists.IndexOf(customList)] = new CustomList() { Name = newListName, ModIds = customList.ModIds }; } }
/// <summary> /// Either update or add the custom list details. /// </summary> /// <param name="listName">Custom list name</param> /// <param name="modId">Mod Id to add to list</param> public void RemoveModFromCustomList(string listName, int modId) { var customList = CustomLists.Find(x => string.Equals(x.Name, listName, StringComparison.OrdinalIgnoreCase)); customList.ModIds.Remove(modId); }