2023-02-28 16:21:08 +00:00
|
|
|
#pragma once
|
|
|
|
#ifndef PAINTSELECTION_H
|
|
|
|
#define PAINTSELECTION_H
|
|
|
|
|
|
|
|
#include "block.h"
|
2023-03-01 23:57:11 +00:00
|
|
|
#include "map.h"
|
2023-02-28 16:21:08 +00:00
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
#include <QPoint>
|
|
|
|
|
2023-03-12 22:21:56 +00:00
|
|
|
enum StampLayer {
|
|
|
|
STAMP_LAYER_BOTTOM,
|
|
|
|
STAMP_LAYER_MIDDLE,
|
|
|
|
STAMP_LAYER_TOP,
|
|
|
|
};
|
|
|
|
|
2023-02-28 16:21:08 +00:00
|
|
|
struct MetatileSelectionItem
|
|
|
|
{
|
|
|
|
bool enabled;
|
|
|
|
uint16_t metatileId;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CollisionSelectionItem
|
|
|
|
{
|
|
|
|
bool enabled;
|
|
|
|
uint16_t collision;
|
|
|
|
uint16_t elevation;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PaintSelection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QPoint dimensions;
|
2023-03-12 22:21:56 +00:00
|
|
|
virtual bool paintNormal(int, Block*, Map*, StampLayer stampLayer) = 0;
|
2023-02-28 16:21:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class MetatileSelection: public PaintSelection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MetatileSelection() {}
|
2023-02-28 22:23:10 +00:00
|
|
|
void clone(MetatileSelection other) {
|
|
|
|
this->dimensions = other.dimensions;
|
|
|
|
this->hasCollision = other.hasCollision;
|
|
|
|
this->metatileItems = other.metatileItems;
|
|
|
|
this->collisionItems = other.collisionItems;
|
|
|
|
}
|
2023-03-12 22:21:56 +00:00
|
|
|
bool paintNormal(int index, Block *block, Map*, StampLayer stampLayer) override;
|
2023-02-28 16:21:08 +00:00
|
|
|
bool hasCollision = false;
|
|
|
|
QList<MetatileSelectionItem> metatileItems;
|
|
|
|
QList<CollisionSelectionItem> collisionItems;
|
|
|
|
};
|
|
|
|
|
|
|
|
class StampSelection: public PaintSelection
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StampSelection() {}
|
2023-03-12 22:21:56 +00:00
|
|
|
bool paintNormal(int index, Block *block, Map*, StampLayer stampLayer) override;
|
2023-02-28 16:21:08 +00:00
|
|
|
QList<uint16_t> stampIds;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PAINTSELECTION_H
|