Add EditorContext, refactor utils, add system managers
This commit is contained in:
32
src/app/editor/system/history_manager.h
Normal file
32
src/app/editor/system/history_manager.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H
|
||||
#define YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace editor {
|
||||
|
||||
// System history manager, undo and redo.
|
||||
class HistoryManager {
|
||||
public:
|
||||
HistoryManager() = default;
|
||||
~HistoryManager() = default;
|
||||
|
||||
void Add(const char* data);
|
||||
void Undo();
|
||||
void Redo();
|
||||
|
||||
private:
|
||||
std::vector<const char*> history_;
|
||||
std::stack<const char*> undo_;
|
||||
std::stack<const char*> redo_;
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H
|
||||
Reference in New Issue
Block a user