+
+ void printUnsatisfiedModsError() const;
+
+protected:
+ ModConfiguration(const std::string &worldpath);
+ // adds all mods in the given path. used for games, modpacks
+ // and world-specific mods (worldmods-folders)
+ void addModsInPath(const std::string &path);
+
+ // adds all mods in the set.
+ void addMods(const std::vector<ModSpec> &new_mods);
+
+ void addModsFromConfig(const std::string &settings_path, const std::set<std::string> &mods);
+
+ void checkConflictsAndDeps();
+private:
+ // move mods from m_unsatisfied_mods to m_sorted_mods
+ // in an order that satisfies dependencies
+ void resolveDependencies();
+
+ // mods with unmet dependencies. Before dependencies are resolved,
+ // this is where all mods are stored. Afterwards this contains
+ // only the ones with really unsatisfied dependencies.
+ std::vector<ModSpec> m_unsatisfied_mods;
+
+ // list of mods sorted such that they can be loaded in the
+ // given order with all dependencies being fullfilled. I.e.,
+ // every mod in this list has only dependencies on mods which
+ // appear earlier in the vector.
+ std::vector<ModSpec> m_sorted_mods;
+
+ // set of mod names for which an unresolved name conflict
+ // exists. A name conflict happens when two or more mods
+ // at the same level have the same name but different paths.
+ // Levels (mods in higher levels override mods in lower levels):
+ // 1. game mod in modpack; 2. game mod;
+ // 3. world mod in modpack; 4. world mod;
+ // 5. addon mod in modpack; 6. addon mod.
+ std::unordered_set<std::string> m_name_conflicts;
+
+ // Deleted default constructor
+ ModConfiguration() = default;
+