Skip to content

Allow for iteration of enum/bitmask constants in order. #1594

@SanderMertens

Description

@SanderMertens

Describe the problem you are trying to solve.
Currently the EcsEnum and EcsBitmask components in the meta addon have a constants field of type ecs_map_t that provides quick access to constants by value. While an application can the iterate map contents, this does not preserve the order in which constants were registered. This can be useful in scenarios like generating documentation or code generation.

Describe the solution you'd like
Add a vector (ecs_vec_t) alongside the ecs_map_t field that stores constants in the order they are registered, with tests that verify the order is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions