|
Unravel Engine C++ Reference
|
Single-undo container for a chain of DEPENDENT actions. More...
#include <composite_action.h>
Public Member Functions | |
| void | add_step (std::function< std::shared_ptr< editing_action_t >()> factory) |
| Append a step to the sequence. Factory is invoked only on the first execution. | |
| void | do_action () override |
| void | undo_action () override |
| auto | is_valid () const -> bool override |
| auto | is_mergeable (const editing_action_t &previous) const -> bool override |
| void | draw_in_inspector (rtti::context &ctx) override |
Public Member Functions inherited from crtp_meta_type< sequence_action_t, editing_action_t > | |
| virtual auto | get_meta_type () const -> entt::meta_type |
| auto | is () const -> bool |
| auto | is (const entt::meta_type &type) const -> bool |
| virtual auto | as_derived () -> entt::meta_any |
Public Attributes | |
| std::vector< std::function< std::shared_ptr< editing_action_t >()> > | step_factories |
| Factories evaluated lazily on the first execution. Cleared once consumed. | |
| std::vector< std::shared_ptr< editing_action_t > > | sub_actions |
| Captured sub-actions after first execution, replayed on redo and reversed on undo. | |
| bool | first_run_done {false} |
Additional Inherited Members | |
Static Public Member Functions inherited from crtp_meta_type< sequence_action_t, editing_action_t > | |
| static auto | get_static_meta_type () -> entt::meta_type |
Single-undo container for a chain of DEPENDENT actions.
Where composite_action_t requires every sub-action to be fully constructed up-front, sequence_action_t accepts "step factories" so later steps can reference values produced by earlier ones (e.g. an entity handle that only exists after the preceding create step has run).
Lifecycle:
Factories returning nullptr are silently skipped, allowing conditional steps.
Definition at line 44 of file composite_action.h.
| void unravel::sequence_action_t::add_step | ( | std::function< std::shared_ptr< editing_action_t >()> | factory | ) |
Append a step to the sequence. Factory is invoked only on the first execution.
Definition at line 109 of file composite_action.cpp.
|
override |
Definition at line 117 of file composite_action.cpp.
|
override |
Definition at line 190 of file composite_action.cpp.
|
override |
Definition at line 185 of file composite_action.cpp.
|
override |
Definition at line 165 of file composite_action.cpp.
|
override |
Definition at line 153 of file composite_action.cpp.
| bool unravel::sequence_action_t::first_run_done {false} |
Definition at line 51 of file composite_action.h.
| std::vector<std::function<std::shared_ptr<editing_action_t>()> > unravel::sequence_action_t::step_factories |
Factories evaluated lazily on the first execution. Cleared once consumed.
Definition at line 47 of file composite_action.h.
| std::vector<std::shared_ptr<editing_action_t> > unravel::sequence_action_t::sub_actions |
Captured sub-actions after first execution, replayed on redo and reversed on undo.
Definition at line 49 of file composite_action.h.