2016-10-24 00:21:40 +02:00
|
|
|
#ifndef TILE_H
|
|
|
|
#define TILE_H
|
|
|
|
|
2018-06-04 23:40:42 +02:00
|
|
|
#include <QVariant>
|
2016-10-24 00:21:40 +02:00
|
|
|
#include <QPixmap>
|
|
|
|
#include <QPoint>
|
|
|
|
|
2023-12-11 18:54:46 +01:00
|
|
|
class FileTile
|
2016-10-24 00:21:40 +02:00
|
|
|
{
|
|
|
|
public:
|
2023-12-11 18:54:46 +01:00
|
|
|
FileTile(const QPoint &xy, const QString &file)
|
|
|
|
: _xy(xy), _file(file) {}
|
2016-10-24 00:21:40 +02:00
|
|
|
|
2018-03-30 10:25:05 +02:00
|
|
|
const QPoint &xy() const {return _xy;}
|
2023-12-11 18:54:46 +01:00
|
|
|
const QString &file() const {return _file;}
|
|
|
|
const QPixmap &pixmap() const {return _pixmap;}
|
|
|
|
|
|
|
|
void load() {_pixmap.load(_file);}
|
2016-10-24 00:21:40 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QPoint _xy;
|
2023-12-11 18:54:46 +01:00
|
|
|
QString _file;
|
2016-10-24 00:21:40 +02:00
|
|
|
QPixmap _pixmap;
|
|
|
|
};
|
|
|
|
|
2023-12-11 18:54:46 +01:00
|
|
|
class DataTile
|
2022-07-06 14:58:41 +02:00
|
|
|
{
|
|
|
|
public:
|
2023-12-11 18:54:46 +01:00
|
|
|
DataTile(const QPoint &xy, const QByteArray &data, const QString &key)
|
2022-07-06 14:58:41 +02:00
|
|
|
: _xy(xy), _data(data), _key(key) {}
|
|
|
|
|
|
|
|
const QPoint &xy() const {return _xy;}
|
|
|
|
const QString &key() const {return _key;}
|
|
|
|
const QPixmap &pixmap() const {return _pixmap;}
|
|
|
|
|
|
|
|
void load() {_pixmap.loadFromData(_data);}
|
|
|
|
|
|
|
|
private:
|
|
|
|
QPoint _xy;
|
|
|
|
QByteArray _data;
|
|
|
|
QString _key;
|
|
|
|
QPixmap _pixmap;
|
|
|
|
};
|
|
|
|
|
2016-10-24 00:21:40 +02:00
|
|
|
#endif // TILE_H
|