Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider renaming entity::Allocator #89

Open
Anders429 opened this issue Aug 18, 2022 · 0 comments
Open

Consider renaming entity::Allocator #89

Anders429 opened this issue Aug 18, 2022 · 0 comments
Labels
A - Storage Area: Storage inside a World. C - Code Quality Category: Addressing quality and cleanup of existing code. P - Low Priority: Not particularly urgent.

Comments

@Anders429
Copy link
Owner

I'm not in love with the use of "Allocator" in this context. It conflicts with the other regular usage of the word "allocator" in relation to heap allocations, which I imagine would only be confusing for someone looking at this library's private API with fresh eyes.

The function of the entity::Allocator is to store the locations of entities (meaning their current archetype and index) using a generational index system. allocate() and allocate_batch() find a free location slot and register the entity's location there, while the other methods simply return the current location or modify that location.

So perhaps entity::Index or entity::Map would be better? Or entity::LocationMap? "Map" denotes key-value, and the current system is just a bunch of locations keyed by generational index (entity::Identifier->Location`).

@Anders429 Anders429 added C - Code Quality Category: Addressing quality and cleanup of existing code. P - Low Priority: Not particularly urgent. A - Storage Area: Storage inside a World. labels Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - Storage Area: Storage inside a World. C - Code Quality Category: Addressing quality and cleanup of existing code. P - Low Priority: Not particularly urgent.
Projects
None yet
Development

No branches or pull requests

1 participant