2015-11-23 23:19:57 +01:00
|
|
|
#ifndef MAPLIST_H
|
|
|
|
#define MAPLIST_H
|
|
|
|
|
2017-04-21 21:15:58 +02:00
|
|
|
#include <QObject>
|
2016-02-12 10:09:17 +01:00
|
|
|
#include <QString>
|
2015-11-23 23:19:57 +01:00
|
|
|
|
2018-03-09 23:24:08 +01:00
|
|
|
class Map;
|
2018-01-14 23:03:27 +01:00
|
|
|
|
2017-04-21 21:15:58 +02:00
|
|
|
class MapList : public QObject
|
2015-11-23 23:19:57 +01:00
|
|
|
{
|
2017-04-21 21:15:58 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2015-11-23 23:19:57 +01:00
|
|
|
public:
|
2017-04-21 21:15:58 +02:00
|
|
|
MapList(QObject *parent = 0) : QObject(parent) {}
|
|
|
|
|
2018-01-28 22:56:08 +01:00
|
|
|
bool loadFile(const QString &path);
|
2018-01-14 23:03:27 +01:00
|
|
|
bool loadDir(const QString &path);
|
2017-04-21 21:15:58 +02:00
|
|
|
|
2017-07-27 19:47:46 +02:00
|
|
|
const QList<Map*> &maps() const {return _maps;}
|
2017-04-21 21:15:58 +02:00
|
|
|
const QString &errorString() const {return _errorString;}
|
|
|
|
|
2017-07-27 19:47:46 +02:00
|
|
|
static QString formats();
|
|
|
|
static QStringList filter();
|
|
|
|
|
2017-04-21 21:15:58 +02:00
|
|
|
private:
|
2018-01-28 22:56:08 +01:00
|
|
|
bool loadFile(const QString &path, bool *atlas, bool dir);
|
2018-02-10 09:57:21 +01:00
|
|
|
bool loadDirR(const QString &path);
|
2019-02-13 00:45:34 +01:00
|
|
|
Map *loadSource(const QString &path, bool dir);
|
2018-05-22 22:40:15 +02:00
|
|
|
bool loadMap(Map *map, const QString &path, bool dir);
|
2017-04-21 21:15:58 +02:00
|
|
|
|
|
|
|
QList<Map*> _maps;
|
|
|
|
QString _errorString;
|
2015-11-23 23:19:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAPLIST_H
|