diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2018-03-16 08:41:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-16 08:41:33 +0100 |
commit | 6c184947c3886ce80aa9eb9807a700025a344442 (patch) | |
tree | a9c9cebb4b9ff2206f93ff02c00c4a801e6fa760 /src/mods.h | |
parent | 5e61f64ce259fe0b23cbb377b44e90a0fbc820d7 (diff) | |
download | minetest-6c184947c3886ce80aa9eb9807a700025a344442.tar.gz minetest-6c184947c3886ce80aa9eb9807a700025a344442.tar.bz2 minetest-6c184947c3886ce80aa9eb9807a700025a344442.zip |
Server: delegate mod management & config to ServerModConfiguration (#7131)
* Server: delegate mod management & config to ServerModConfiguration (rename it to ServerModManager)
* Use c++11 range based loops
* Add unittests + experimental/default mod as a test case to permit testing mod loading in future tests
Diffstat (limited to 'src/mods.h')
-rw-r--r-- | src/mods.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/mods.h b/src/mods.h index 9f4d29739..037d6bd1c 100644 --- a/src/mods.h +++ b/src/mods.h @@ -78,7 +78,7 @@ public: return m_unsatisfied_mods.empty(); } - std::vector<ModSpec> getMods() + const std::vector<ModSpec> &getMods() const { return m_sorted_mods; } @@ -102,6 +102,13 @@ protected: void addModsFromConfig(const std::string &settings_path, const std::set<std::string> &mods); void checkConflictsAndDeps(); +protected: + // 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; + private: // move mods from m_unsatisfied_mods to m_sorted_mods // in an order that satisfies dependencies @@ -112,12 +119,6 @@ private: // 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. @@ -132,13 +133,6 @@ private: }; -class ServerModConfiguration: public ModConfiguration -{ -public: - ServerModConfiguration(const std::string &worldpath); - -}; - #ifndef SERVER class ClientModConfiguration: public ModConfiguration { |