1 #ifndef TILEMAPUNDOCOMMAND_H 2 #define TILEMAPUNDOCOMMAND_H 7 #include <QUndoCommand> 30 QRegion changedPoints,
32 const QString &text =
"Changed templates for tiles.",
33 QUndoCommand *parent =
nullptr,
35 bool canMerge =
false);
49 template<
typename QPo
intIterable >
52 QPointIterable changedPoints,
54 const QString &text =
"Changed templates for tiles.",
55 QUndoCommand *parent =
nullptr)
58 for (
const QPoint &pt : changedPoints)
59 region += QRect(pt.x(), pt.y(), 1, 1);
60 return make(tileMap, region, newTileTemplate, text, parent);
67 int id()
const override {
return mId; }
69 bool mergeWith(
const QUndoCommand *other);
74 QVector<QPoint> changedPositions,
75 QVector<TileTemplate *> oldTemplates,
80 bool canMerge =
false);
84 QVector<QPoint> mChangedTilePositions;
85 QVector<TileTemplate *> mOldTemplatePointers;
92 #endif // TILEMAPUNDOCOMMAND_H int id() const override
Definition: tiletemplatechangecommand.h:67
static TileTemplateChangeCommand * make(TileMap *tileMap, QPointIterable changedPoints, TileTemplate *newTileTemplate, const QString &text="Changed templates for tiles.", QUndoCommand *parent=nullptr)
make Creates the TileTemplateChangeCommand. This will automatically crop the given region so that it ...
Definition: tiletemplatechangecommand.h:50
static TileTemplateChangeCommand * make(TileMap *tileMap, QRegion changedPoints, TileTemplate *newTileTemplate, const QString &text="Changed templates for tiles.", QUndoCommand *parent=nullptr, int id=-1, bool canMerge=false)
make Creates the TileTemplateChangeCommand. This will automatically crop the given region so that it ...
Definition: tiletemplatechangecommand.cpp:5
void undo() override
Definition: tiletemplatechangecommand.cpp:85
bool mergeWith(const QUndoCommand *other)
Definition: tiletemplatechangecommand.cpp:112
void redo() override
Definition: tiletemplatechangecommand.cpp:101
Definition: tiletemplate.h:13
Definition: tiletemplatechangecommand.h:11