Struct basic_collector<>


#include <src/entt/entity/observer.hpp>

struct basic_collector<>



A collector contains a set of rules (literally, matchers) to use to track entities.
Its main purpose is to generate a descriptor that allows an observer to know how to connect to a registry.


groupAdds a grouping matcher to the collector.
updateAdds an observing matcher to the collector.


Lines 41-63 in src/entt/entity/observer.hpp.

struct basic_collector<> {
     * @brief Adds a grouping matcher to the collector.
     * @tparam AllOf Types of components tracked by the matcher.
     * @tparam NoneOf Types of components used to filter out entities.
     * @return The updated collector.
    template<typename... AllOf, typename... NoneOf>
    static constexpr auto group(exclude_t<NoneOf...> = {}) ENTT_NOEXCEPT {
        return basic_collector<matcher<type_list<>, type_list<>, type_list<NoneOf...>, AllOf...>>{};

     * @brief Adds an observing matcher to the collector.
     * @tparam AnyOf Type of component for which changes should be detected.
     * @return The updated collector.
    template<typename AnyOf>
    static constexpr auto update() ENTT_NOEXCEPT {
        return basic_collector<matcher<type_list<>, type_list<>, AnyOf>>{};

Add Discussion

Log in to comment