← API Reference Namespace

asge::ecs

Namespaces

Classes & Structs

Typedefs

#using ComponentTypeId = std::size_t

Dense, monotonically-assigned identifier for a component type.

#using EntityIndex = std::uint32_t
#using EntityGeneration = std::uint32_t

Variables

#static constexpr std::size_t component_cap_v = ComponentCapacity<T>::value
#static constexpr std::size_t kMaxEntities = 4096

Maximum number of entities in the EntityAllocator.

Functions

#ComponentTypeId NextComponentTypeId() noexcept

Hands out the next unused ComponentTypeId.

Not meant to be called directly — GetComponentTypeId<T>() is the only intended caller, using it to lazily assign each type its own id once.

Warning

The counter is a plain, unsynchronized static: concurrent first calls for different types from multiple threads would race.

#template<typename T> ComponentTypeId GetComponentTypeId() noexcept

Returns the stable ComponentTypeId for type T.

The id is assigned the first time this is called for T and cached in a function-local static, so every later call for the same T returns that same value for the rest of the program's run. Assignment order depends on call order, so ids must not be persisted or assumed equal across separate runs, builds, or processes.

Template Parameters
T

Component type to identify.

#std::uint64_t PackEntity(Entity inE) noexcept

Packs an Entity's index+generation into one orderable integer — the basis for EntityPair's operator<.

#EntityPair MakeCanonicalPair(Entity inA, Entity inB) noexcept

Builds an EntityPair with the lower-packed Entity always first, so (a, b) and (b, a) produce the same key.