File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -30,22 +30,30 @@ namespace ecsact::entt {
30
30
template <typename Package>
31
31
class runtime {
32
32
/* *
33
- * Checks if type T is listd as one of the actions in the ecact package.
33
+ * Checks if type T is listd as one of the actions in the ecsact package or
34
+ * one of it's dependencies.
34
35
* @returns `true` if T is a component belonging to `package`, `false`
35
36
* otherwise.
36
37
*/
37
38
template <typename T>
38
39
static constexpr bool is_action () {
39
40
using boost::mp11::mp_any;
41
+ using boost::mp11::mp_append;
40
42
using boost::mp11::mp_apply;
41
43
using boost::mp11::mp_bind_front;
42
44
using boost::mp11::mp_transform_q;
45
+ using ecsact::entt::detail::mp_actions_t ;
46
+ using ecsact::entt::detail::mp_package_dependencies_recursive;
47
+
48
+ using actions = typename mp_append<
49
+ mp_actions_t <Package>,
50
+ mp_package_dependencies_recursive<typename Package::dependencies>>::type;
43
51
44
52
return mp_apply<
45
53
mp_any,
46
54
mp_transform_q<
47
55
mp_bind_front<std::is_same, std::remove_cvref_t <T>>,
48
- typename Package:: actions>>::value;
56
+ actions>>::value;
49
57
}
50
58
51
59
using registry_info = ecsact_entt_rt::registry_info<Package>;
Original file line number Diff line number Diff line change @@ -49,12 +49,12 @@ void ecsact_system_execution_context_action(
49
49
ecsact_system_execution_context* context,
50
50
void * out_action_data
51
51
) {
52
- using boost::mp11::mp_for_each ;
52
+ using ecsact::entt::detail::mp_for_each_available_action ;
53
53
54
54
auto action_id = static_cast <ecsact_action_id>(context->system_id );
55
55
56
56
cast_and_use_ctx (context, [&](auto & context) {
57
- mp_for_each< typename package::actions >([&]<typename A>(A) {
57
+ mp_for_each_available_action< package>([&]<typename A>(A) {
58
58
if (A::id == action_id) {
59
59
A& out_action = *reinterpret_cast <A*>(out_action_data);
60
60
out_action = *reinterpret_cast <const A*>(context.action );
You can’t perform that action at this time.
0 commit comments