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

Component Ids #498

Merged
merged 10 commits into from
Jan 5, 2024
Merged

Component Ids #498

merged 10 commits into from
Jan 5, 2024

Conversation

McCallisterRomer
Copy link
Member

@McCallisterRomer McCallisterRomer commented Jan 3, 2024

part of #420

Another piece needed for serialization. When deserializing component data, we need a way to map the individual blobs back to something that knows what to do with them (pool/handler). Adding an integer id that can be either automatically assigned or manually overridden.

All engine types have explicitly set ids. I added these as static members to each type, which isn't necessary, but it seems like a potentially useful pattern for templated code (for example, see RegistryFactories.cpp in this changeset).

Added a few utility functions to ComponentRegistry and AnyComponent for future use of the id.

Unrelated to the id, but I also changed the order in which components are registered. This influences the order of component widgets in the editor (would be nice to be able to change that, but that's a whole thing...).

@McCallisterRomer McCallisterRomer marked this pull request as ready for review January 3, 2024 22:04
include/ncengine/audio/AudioSource.h Outdated Show resolved Hide resolved
include/ncengine/ecs/AnyComponent.h Outdated Show resolved Hide resolved
include/ncengine/ecs/Component.h Outdated Show resolved Hide resolved
@McCallisterRomer McCallisterRomer merged commit e0e6c7b into vnext Jan 5, 2024
10 checks passed
@McCallisterRomer McCallisterRomer deleted the cal/component_ids branch January 5, 2024 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants