[studio,nostalgia] Fix PaletteEditor color update command merging, add setObsolete

This commit is contained in:
2024-09-30 23:07:14 -05:00
parent 1f6fefdb68
commit c6efabaa1d
6 changed files with 27 additions and 12 deletions

View File

@@ -17,13 +17,22 @@ class NoChangesException: public ox::Exception {
};
class UndoCommand {
private:
bool m_obsolete{};
public:
virtual ~UndoCommand() noexcept = default;
virtual ox::Error redo() noexcept = 0;
virtual ox::Error undo() noexcept = 0;
[[nodiscard]]
virtual int commandId() const noexcept = 0;
virtual bool mergeWith(UndoCommand const&cmd) noexcept;
virtual bool mergeWith(UndoCommand &cmd) noexcept;
constexpr void setObsolete(bool obsolete) noexcept {
m_obsolete = obsolete;
}
[[nodiscard]]
constexpr bool isObsolete() const noexcept {
return m_obsolete;
}
};
}