GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
entity_range.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Ivar Härnqvist
2// SPDX-License-Identifier: MIT
3
4#ifndef GREM_EXECUTION_ENTITY_RANGE_HPP
5#define GREM_EXECUTION_ENTITY_RANGE_HPP
6
8
9#include <type_traits> // std::false_type, std::true_type
10
11namespace grem::execution {
12
19template <typename Component>
20struct Exclude {};
21
23template <typename T>
24struct remove_exclude {
25 using type = T;
26};
27
28template <typename Component>
29struct remove_exclude<Exclude<Component>> {
30 using type = Component;
31};
33
42template <typename T>
43using remove_exclude_t = typename remove_exclude<T>::type;
44
46template <typename T>
47struct is_exclude : std::false_type {};
48
49template <typename T>
50struct is_exclude<Exclude<T>> : std::true_type {};
52
59template <typename T>
60inline constexpr bool is_exclude_v = is_exclude<T>::value;
61
63template <typename T>
64struct is_entity_range : std::false_type {};
66
80template <typename T>
81inline constexpr bool is_entity_range_v = is_entity_range<T>::value;
82
84template <typename EntityRange>
85struct entity_range_components_and_exclusions;
87
102template <typename EntityRange>
103using entity_range_components_and_exclusions_t = typename entity_range_components_and_exclusions<EntityRange>::type;
104
105} // namespace grem::execution
106
107#endif
Definition Chunk.hpp:19
typename entity_range_components_and_exclusions< EntityRange >::type entity_range_components_and_exclusions_t
Component and component exclusion types of an entity range type, provided as a meta::TypeList.
Definition entity_range.hpp:103
constexpr bool is_entity_range_v
Boolean that evaluates to true if the given type is considered an entity range type.
Definition entity_range.hpp:81
constexpr bool is_exclude_v
Boolean that evaluates to true if the given type is a specialization of Exclude.
Definition entity_range.hpp:60
typename remove_exclude< T >::type remove_exclude_t
The excluded component type of a component exclusion type.
Definition entity_range.hpp:43
Component exclusion tag type, for excluding entities from an entity range if they have a specific com...
Definition entity_range.hpp:20