summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/ftb/FTBInstanceProvider.h
blob: fb3ecb6c4941c843be35c693dcbb30e0454d8b4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once

#include "BaseInstanceProvider.h"
#include <QMap>

class QFileSystemWatcher;

struct MULTIMC_LOGIC_EXPORT FTBRecord
{
	QString dirName;
	QString name;
	QString logo;
	QString iconKey;
	QString mcVersion;
	QString description;
	QString instanceDir;
	QString templateDir;
	bool operator==(const FTBRecord other) const
	{
		return instanceDir == other.instanceDir;
	}
};

class MULTIMC_LOGIC_EXPORT FTBInstanceProvider : public BaseInstanceProvider
{
	Q_OBJECT

public:
	FTBInstanceProvider (SettingsObjectPtr settings);

public:
	QList<InstanceId> discoverInstances() override;
	InstancePtr loadInstance(const InstanceId& id) override;
	void loadGroupList() override {};
	void saveGroupList() override {};

private: /* methods */
	void discoverFTBEntries();
	InstancePtr createInstance(const FTBRecord & record) const;
	InstancePtr loadInstance(const FTBRecord & record) const;


private:
	QMap<InstanceId, FTBRecord> m_records;
};