24#ifndef STELLARLIB_ECS_ARCHETYPE_HPP
25#define STELLARLIB_ECS_ARCHETYPE_HPP
27#include <stellarlib/ecs/sparse_storage.hpp>
28#include <stellarlib/ext/memory.hpp>
49 template <
typename ...T>
51 static constexpr auto of() noexcept
54 if constexpr (
sizeof...(T)) {
55 static const auto cache{[] [[nodiscard]]
noexcept ->
archetype {
58 for (
const auto id : internal::sparse_storage::ids<T...>()) {
165 void erase(std::uintmax_t
id) noexcept;
179 std::uintmax_t *_begin{};
180 std::uintmax_t *_end{};
181 std::uintmax_t _size{};
182 std::uintmax_t _capacity{};
static constexpr auto of() noexcept -> std::conditional_t< static_cast< bool >(sizeof...(T)), const archetype &, archetype >
Retrieves an archetype for a set of component types.
Definition archetype.hpp:51
void erase(std::uintmax_t id) noexcept
Removes a component ID from the archetype.
void clear() noexcept
Removes all component IDs from the archetype.
auto contains(std::uintmax_t id) const noexcept -> bool
Evaluates whether the archetype contains a component ID.
archetype() noexcept
Default constructor.
void insert(std::uintmax_t id) noexcept
Inserts a component ID into the archetype.
Linear memory allocator optimized for vectors.
Definition memory.hpp:50
Entity component system.
Definition any_set.hpp:28