From 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 Mon Sep 17 00:00:00 2001 From: Thomas Groman Date: Thu, 19 Sep 2019 00:41:48 -0700 Subject: merged from 0.6.7 codebase --- api/logic/modplatform/ftb/FtbPrivatePackManager.h | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 api/logic/modplatform/ftb/FtbPrivatePackManager.h (limited to 'api/logic/modplatform/ftb/FtbPrivatePackManager.h') diff --git a/api/logic/modplatform/ftb/FtbPrivatePackManager.h b/api/logic/modplatform/ftb/FtbPrivatePackManager.h new file mode 100644 index 00000000..388224d6 --- /dev/null +++ b/api/logic/modplatform/ftb/FtbPrivatePackManager.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include +#include +#include "multimc_logic_export.h" + +class MULTIMC_LOGIC_EXPORT FtbPrivatePackManager +{ +public: + ~FtbPrivatePackManager() + { + save(); + } + void load(); + void save() const; + bool empty() const + { + return currentPacks.empty(); + } + const QSet &getCurrentPackCodes() const + { + return currentPacks; + } + void add(const QString &code) + { + currentPacks.insert(code); + dirty = true; + } + void remove(const QString &code) + { + currentPacks.remove(code); + dirty = true; + } + +private: + QSet currentPacks; + QString m_filename = "private_packs.txt"; + mutable bool dirty = false; +}; -- cgit v1.2.3