public void AddFavorite(IMod mod) { lock (FavoriteMods) { if (FavoriteMods.Any(f => f.Matches(mod))) { return; } FavoriteMods.Add(new FavoriteMod(mod)); } SaveSettings(); }
public void RemoveFavorite(IMod mod) { lock (FavoriteMods) { var favorite = FavoriteMods.FirstOrDefault(f => f.Matches(mod)); if (favorite == null) { return; } FavoriteMods.Remove(favorite); } SaveSettings(); }
public bool IsFavorite(IMod mod) => FavoriteMods.Any(f => f.Matches(mod));