| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2018 Rerrah |
| 3 |
* SPDX-License-Identifier: MIT |
| 4 |
*/ |
| 5 |
|
| 6 |
#pragma once |
| 7 |
|
| 8 |
#include "command_id.hpp" |
| 9 |
|
| 10 |
class AbstractCommand |
| 11 |
{ |
| 12 |
public: |
| 13 |
AbstractCommand(CommandId id) : id_(id) {} |
| 14 |
virtual ~AbstractCommand() = default; |
| 15 |
virtual bool redo() = 0; |
| 16 |
virtual bool undo() = 0; |
| 17 |
inline CommandId getID() const noexcept { return id_; } |
| 18 |
virtual bool mergeWith(const AbstractCommand* other) |
| 19 |
{ |
| 20 |
(void)other; |
| 21 |
return false; |
| 22 |
} |
| 23 |
|
| 24 |
private: |
| 25 |
const CommandId id_; |
| 26 |
}; |