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