Support ecs behavior::begin called when starting iteration over a species

This commit is contained in:
Nikita Lisitsa 2022-08-19 09:49:41 +03:00
parent 34ee3f0a6e
commit 876cbd7362

View file

@ -142,6 +142,8 @@ namespace psemek::util
((std::get<Components *>(ctx.components) = get_species_component<Components>()), ...);
behavior.begin({id_}, *std::get<Components *>(ctx.components)...);
auto visit = [&](auto * ... ptrs)
{
if constexpr (std::is_invocable_v<Behavior, typename Components::data & ..., typename Behavior::context const &, Args const & ...>)
@ -441,6 +443,8 @@ namespace psemek::util
return *std::get<Component *>(components);
}
};
void begin(species_handle, Components const & ...) {}
};
enum class policy