2018-08-01 22:52:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QSet>
|
|
|
|
#include <QString>
|
|
|
|
#include <QFile>
|
|
|
|
|
2019-11-03 22:48:12 +00:00
|
|
|
namespace LegacyFTB {
|
|
|
|
|
2021-07-25 17:11:59 +00:00
|
|
|
class PrivatePackManager
|
2018-08-01 22:52:31 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-11-03 22:48:12 +00:00
|
|
|
~PrivatePackManager()
|
2018-08-01 22:52:31 +00:00
|
|
|
{
|
|
|
|
save();
|
|
|
|
}
|
|
|
|
void load();
|
|
|
|
void save() const;
|
|
|
|
bool empty() const
|
|
|
|
{
|
|
|
|
return currentPacks.empty();
|
|
|
|
}
|
|
|
|
const QSet<QString> &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<QString> currentPacks;
|
|
|
|
QString m_filename = "private_packs.txt";
|
|
|
|
mutable bool dirty = false;
|
|
|
|
};
|
2019-11-03 22:48:12 +00:00
|
|
|
|
|
|
|
}
|