5#include <aegis2d/ecs/export.hpp>
56 [[nodiscard]] std::size_t
size() const noexcept;
60 [[nodiscard]]
std::
size_t slot_count() const noexcept;
64 [[nodiscard]]
std::
size_t free_count() const noexcept;
75 std::vector<Slot> slots_;
76 std::deque<Entity::Index> free_;
Hands out entity handles and recycles the indices of destroyed entities.
Definition entity_allocator.hpp:25
bool alive(Entity entity) const noexcept
Tells whether a handle designates a living entity.
bool destroy(Entity entity)
Destroys an entity: its index gets a new generation and goes to the free list.
void reserve(std::size_t slots)
Prepares room for a number of indices without reallocating.
Entity create()
Creates an entity.
std::size_t size() const noexcept
Number of living entities.
void clear()
Destroys every living entity, as destroy() would.
Handle to an entity: 32 bits made of a 24-bit index and an 8-bit generation.
Definition entity.hpp:23
std::uint8_t Generation
Reuse counter of an index.
Definition entity.hpp:28
Generational entity handle: an index into the component pools plus a generation.
Entity-Component-System used by client and server.
Definition animation.hpp:13
Definition endpoint.hpp:85