Unravel Engine C++ Reference
Loading...
Searching...
No Matches
undo_redo_stack.h
Go to the documentation of this file.
1#pragma once
2
3#include "editing_action.h"
4#include <memory>
5#include <vector>
6
7namespace unravel
8{
9
11{
12 std::vector<std::shared_ptr<editing_action_t>> actions;
13 size_t current_index{0}; // Points to the last executed action (0 = no actions executed)
14
15 void push_if_undoable(std::shared_ptr<editing_action_t> action);
16
17 auto can_undo() const -> bool;
18 auto can_redo() const -> bool;
19
20 void undo();
21 void redo();
22 void clear();
23};
24
25} // namespace unravel
void push_if_undoable(std::shared_ptr< editing_action_t > action)
auto can_undo() const -> bool
auto can_redo() const -> bool
std::vector< std::shared_ptr< editing_action_t > > actions