From 6c184947c3886ce80aa9eb9807a700025a344442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Fri, 16 Mar 2018 08:41:33 +0100 Subject: 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 --- src/mods.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src/mods.h') 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 getMods() + const std::vector &getMods() const { return m_sorted_mods; } @@ -102,6 +102,13 @@ protected: void addModsFromConfig(const std::string &settings_path, const std::set &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 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 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 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 { -- cgit v1.2.3