Unravel Engine C++ Reference
Loading...
Searching...
No Matches
lambda_actions.h
Go to the documentation of this file.
1#pragma once
2
3#include "editing_action.h"
4#include <functional>
5
6namespace unravel
7{
8
9// Non-undoable lambda action
10struct untracked_action_t : crtp_meta_type<untracked_action_t, editing_action_t>
11{
12 using action_t = std::function<void()>;
14
16
17 void do_action() override;
18 void undo_action() override;
19 auto is_undoable() const -> bool override;
20};
21
22// Undoable lambda action with separate do/undo functions
24{
25 using action_t = std::function<void()>;
26 action_t do_func{};
27 action_t undo_func{};
28
30
31 void do_action() override;
32 void undo_action() override;
33 auto is_undoable() const -> bool override;
34};
35
36} // namespace unravel
std::function< void()> action_t
auto is_undoable() const -> bool override
std::function< void()> action_t