#pragma once #include #include #include "json.hpp" using json = nlohmann::json; class Command { protected: std::chrono::system_clock::time_point timestamp; public: virtual ~Command() = default; virtual void Execute() = 0; virtual void Undo() = 0; virtual json SerializeArgs() = 0; const json Serialize(); virtual std::string GetTitle() = 0; // can be different for same command, used in user facing context virtual const char* GetIdentity() const = 0; // is always the same for a command, used internaly };