diff --git a/ecsact/runtime/meta.hh b/ecsact/runtime/meta.hh index 4e5a5e5a..25e799d7 100644 --- a/ecsact/runtime/meta.hh +++ b/ecsact/runtime/meta.hh @@ -447,6 +447,36 @@ ECSACT_ALWAYS_INLINE auto system_capabilities(SystemLikeID id) { return result; } +template +ECSACT_ALWAYS_INLINE auto system_capabilities_list(SystemLikeID id) { + using result_t = + std::vector>; + + const auto sys_like_id = ecsact_id_cast(id); + auto count = ecsact_meta_system_capabilities_count(sys_like_id); + std::vector components; + std::vector capabilities; + components.resize(count); + capabilities.resize(count); + + ecsact_meta_system_capabilities( + sys_like_id, + count, + components.data(), + capabilities.data(), + nullptr + ); + + result_t result; + result.reserve(count); + + for(decltype(count) i = 0; count > i; ++i) { + result.emplace_back(components[i], capabilities[i]); + } + + return result; +} + template ECSACT_ALWAYS_INLINE auto get_system_generates_ids(SystemLikeID id) { auto sys_like_id = ecsact_id_cast(id);