mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Don't inherit Game from LoadOrderHandler
Use a private LoadOrderHandler member instead. This will simplify creating a Game interface.
This commit is contained in:
@@ -117,7 +117,7 @@ void Game::Init() {
|
||||
}
|
||||
}
|
||||
|
||||
LoadOrderHandler::Init(*this, localDataPath_);
|
||||
loadOrderHandler_.Init(*this, localDataPath_);
|
||||
}
|
||||
|
||||
void Game::RedatePlugins() {
|
||||
@@ -245,7 +245,7 @@ bool Game::IsPluginActive(const std::string& pluginName) const {
|
||||
try {
|
||||
return GetPlugin(pluginName).IsActive();
|
||||
} catch (...) {
|
||||
return LoadOrderHandler::IsPluginActive(pluginName);
|
||||
return loadOrderHandler_.IsPluginActive(pluginName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,14 +275,14 @@ short Game::GetActiveLoadOrderIndex(const std::string & pluginName, const std::v
|
||||
|
||||
std::vector<std::string> Game::GetLoadOrder() const {
|
||||
if (loadOrder_.empty())
|
||||
loadOrder_ = LoadOrderHandler::GetLoadOrder();
|
||||
loadOrder_ = loadOrderHandler_.GetLoadOrder();
|
||||
|
||||
return loadOrder_;
|
||||
}
|
||||
|
||||
void Game::SetLoadOrder(const std::vector<std::string>& loadOrder) const {
|
||||
BackupLoadOrder(loadOrder_, lootDataPath_ / FolderName());
|
||||
LoadOrderHandler::SetLoadOrder(loadOrder);
|
||||
loadOrderHandler_.BackupLoadOrder(loadOrder_, lootDataPath_ / FolderName());
|
||||
loadOrderHandler_.SetLoadOrder(loadOrder);
|
||||
loadOrder_ = loadOrder;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "backend/game/load_order_handler.h"
|
||||
|
||||
namespace loot {
|
||||
class Game : public GameSettings, public LoadOrderHandler, public GameCache {
|
||||
class Game : public GameSettings, public GameCache {
|
||||
public:
|
||||
Game(const GameSettings& gameSettings,
|
||||
const boost::filesystem::path& lootDataPath,
|
||||
@@ -69,6 +69,7 @@ private:
|
||||
const boost::filesystem::path localDataPath_;
|
||||
|
||||
bool pluginsFullyLoaded_;
|
||||
LoadOrderHandler loadOrderHandler_;
|
||||
mutable std::vector<std::string> loadOrder_;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ Plugin::Plugin(const Game& game, const std::string& name, const bool headerOnly)
|
||||
}
|
||||
}
|
||||
// Get whether the plugin is active or not.
|
||||
isActive_ = game.LoadOrderHandler::IsPluginActive(Name());
|
||||
isActive_ = game.IsPluginActive(Name());
|
||||
|
||||
// Get whether the plugin loads an archive (BSA/BA2) or not.
|
||||
const string archiveExtension = game.GetArchiveFileExtension();
|
||||
|
||||
Reference in New Issue
Block a user