Unravel Engine C++ Reference
Loading...
Searching...
No Matches
property_actions.h
Go to the documentation of this file.
1#pragma once
2
3#include "editing_action.h"
4#include "composite_action.h"
5#include "entt/meta/meta.hpp"
8#include <math/math.h>
9
10namespace unravel
11{
12
13
14struct property_action_t : crtp_meta_type<property_action_t, editing_action_t>
15{
17 entt::meta_any old_value;
18 entt::meta_any new_value;
19 entt::meta_custom custom;
20 std::function<void()> on_success;
21
22 property_action_t(meta_any_proxy inst, const entt::meta_any& old_val, const entt::meta_any& new_val, const entt::meta_custom& custom = {}, const std::function<void()>& on_success = {});
23
24 void do_action() override;
25 void undo_action() override;
26 auto is_mergeable(const editing_action_t& previous) const -> bool override;
27 void merge_with(const editing_action_t& previous) override;
28 auto is_valid() const -> bool override;
29 void draw_in_inspector(rtti::context& ctx) override;
30};
31
32} // namespace unravel
Safe deferred property access proxy for arbitrary object properties.
Definition inspector.h:198
auto is_mergeable(const editing_action_t &previous) const -> bool override
void draw_in_inspector(rtti::context &ctx) override
property_action_t(meta_any_proxy inst, const entt::meta_any &old_val, const entt::meta_any &new_val, const entt::meta_custom &custom={}, const std::function< void()> &on_success={})
void merge_with(const editing_action_t &previous) override
std::function< void()> on_success
auto is_valid() const -> bool override