Skip to content

Commit e862789

Browse files
committed
Misc organization
1 parent aa243de commit e862789

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

Managers/ModuleMan.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ namespace RTE {
3030
Clear();
3131
}
3232

33+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
34+
35+
bool ModuleMan::IsModuleEnabled(const std::string_view &moduleName) const {
36+
return std::none_of(m_DisabledDataModuleNames.begin(), m_DisabledDataModuleNames.end(),
37+
[&moduleName](const std::string_view &disabledModuleName) {
38+
return disabledModuleName == moduleName;
39+
}
40+
);
41+
}
42+
3343
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3444

3545
bool ModuleMan::IsModuleOfficial(const std::string_view &moduleName) const {
@@ -248,14 +258,4 @@ namespace RTE {
248258
}
249259
}
250260
}
251-
252-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
253-
254-
bool ModuleMan::IsModuleEnabled(const std::string_view &moduleName) const {
255-
return std::none_of(m_DisabledDataModuleNames.begin(), m_DisabledDataModuleNames.end(),
256-
[&moduleName](const std::string_view &disabledModuleName) {
257-
return disabledModuleName == moduleName;
258-
}
259-
);
260-
}
261261
}

Managers/ModuleMan.h

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ namespace RTE {
4444
/// <returns>The total number of loaded DataModules.</returns>
4545
int GetTotalModuleCount() const { return static_cast<int>(m_LoadedDataModules.size()); }
4646

47+
/// <summary>
48+
/// Gets whether the specified mod is disabled in the settings.
49+
/// </summary>
50+
/// <param name="moduleName">Mod to check.</param>
51+
/// <returns>Whether the module is disabled via settings.</returns>
52+
bool IsModuleEnabled(const std::string_view &moduleName) const;
53+
4754
/// <summary>
4855
/// Gets whether a module name is of an official DataModule.
4956
/// </summary>
@@ -82,6 +89,12 @@ namespace RTE {
8289
#pragma endregion
8390

8491
#pragma region DataModule Info Getters
92+
/// <summary>
93+
/// Gets the DataModule names that are disabled and should not be loaded at startup.
94+
/// </summary>
95+
/// <returns>Map of mods which are disabled.</returns>
96+
std::unordered_set<std::string> & GetDisabledDataModuleNames() { return m_DisabledDataModuleNames; }
97+
8598
/// <summary>
8699
/// Gets the ID of a loaded DataModule.
87100
/// </summary>
@@ -118,21 +131,6 @@ namespace RTE {
118131
std::string GetFullModulePath(const std::string &modulePath) const;
119132
#pragma endregion
120133

121-
#pragma region DataModule Management
122-
/// <summary>
123-
/// Gets the DataModule names that are disabled and should not be loaded at startup.
124-
/// </summary>
125-
/// <returns>Map of mods which are disabled.</returns>
126-
std::unordered_set<std::string> & GetDisabledDataModuleNames() { return m_DisabledDataModuleNames; }
127-
128-
/// <summary>
129-
/// Gets whether the specified mod is disabled in the settings.
130-
/// </summary>
131-
/// <param name="moduleName">Mod to check.</param>
132-
/// <returns>Whether the module is disabled via settings.</returns>
133-
bool IsModuleEnabled(const std::string_view &moduleName) const;
134-
#pragma endregion
135-
136134
#pragma region Contrete Methods
137135
/// <summary>
138136
/// Reads an entire DataModule and adds it to this. NOTE that official modules can't be loaded after any non-official ones!

0 commit comments

Comments
 (0)