#ifndef GAME_EDITOR_EDITOR_HISTORY_H #define GAME_EDITOR_EDITOR_HISTORY_H #include "editor_action.h" #include class CEditorHistory { public: CEditorHistory() { m_pEditor = nullptr; } ~CEditorHistory() { Clear(); } void RecordAction(const std::shared_ptr &pAction); void RecordAction(const std::shared_ptr &pAction, const char *pDisplay); void Execute(const std::shared_ptr &pAction, const char *pDisplay = nullptr); bool Undo(); bool Redo(); void Clear(); bool CanUndo() const { return !m_vpUndoActions.empty(); } bool CanRedo() const { return !m_vpRedoActions.empty(); } CEditor *m_pEditor; std::deque> m_vpUndoActions; std::deque> m_vpRedoActions; }; #endif