Ejemplo n.º 1
0
 /// <summary>
 /// Checks whether all of a given set of ModKeys are in the collection of listings.
 /// </summary>
 /// <param name="loadOrder">LoadOrder to query</param>
 /// <param name="modKeys">ModKeys to look for</param>
 /// <returns>True if all ModKeys are present in the listings</returns>
 public static bool HasMods(this ILoadOrderGetter loadOrder, IEnumerable <ModKey> modKeys)
 {
     foreach (var key in modKeys)
     {
         if (!loadOrder.ContainsKey(key))
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Checks whether all of a given set of ModKeys are in the collection of listings.
        /// </summary>
        /// <param name="loadOrder">Listings to look through</param>
        /// <param name="modKeys">ModKeys to look for</param>
        /// <returns>True if all ModKeys are present in the listings</returns>
        public static bool HasMods(this ILoadOrderGetter <IModListingGetter> loadOrder, params ModKey[] modKeys)
        {
            foreach (var key in modKeys)
            {
                if (!loadOrder.ContainsKey(key))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Checks whether a given mod is in the collection of keys.
 /// </summary>
 /// <param name="loadOrder">LoadOrder to query</param>
 /// <param name="modKey">ModKey to look for</param>
 /// <returns>True if ModKey is in the listings, with the desired enabled state</returns>
 public static bool HasMod(this ILoadOrderGetter loadOrder, ModKey modKey)
 {
     return(loadOrder.ContainsKey(modKey));
 }