2018-08-02 04:22:31 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QSet>
|
|
|
|
#include <QString>
|
|
|
|
#include <QFile>
|
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
|
2019-11-04 04:18:12 +05:30
|
|
|
namespace LegacyFTB {
|
|
|
|
|
|
|
|
class MULTIMC_LOGIC_EXPORT PrivatePackManager
|
2018-08-02 04:22:31 +05:30
|
|
|
{
|
|
|
|
public:
|
2019-11-04 04:18:12 +05:30
|
|
|
~PrivatePackManager()
|
2018-08-02 04:22:31 +05:30
|
|
|
{
|
|
|
|
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-04 04:18:12 +05:30
|
|
|
|
|
|
|
}
|