Skip to content

feat(core): entity temporary components#43

Merged
ripel2 merged 5 commits into
mainfrom
temporary-component
Oct 25, 2024
Merged

feat(core): entity temporary components#43
ripel2 merged 5 commits into
mainfrom
temporary-component

Conversation

@Miou-zora
Copy link
Copy Markdown
Contributor

@Miou-zora Miou-zora commented Oct 25, 2024

I added a way to create component that should have a short lifecycle (1 cycle of run systems) that can allow to update entities only if needed.

For exemple, for buttons, I don't want to check all entities if there state has changed in every system that use button component so went I hover or click on a button, I've added a temporary component HasChanged<Button> to only check these entities.

To add this feature inside your project, just add Entity::RemoveTemporaryComponents at the end of all of your systems and call AddTemporaryComponent to add a temporary component.

@Miou-zora Miou-zora added the enhancement New feature or request label Oct 25, 2024
@Miou-zora Miou-zora requested a review from a team October 25, 2024 13:36
@Miou-zora Miou-zora self-assigned this Oct 25, 2024
@Miou-zora Miou-zora changed the title feat(engine): add AddTemporaryComponent and RemoveTags system with test Create Temporary component for optimization Oct 25, 2024
Copy link
Copy Markdown
Contributor

@ripel2 ripel2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea but it could be more clear to rename those temporary components as "tags" everywhere for clarity

Comment thread src/engine/entity/Entity.hpp
Comment thread src/engine/entity/Entity.hpp
@Miou-zora Miou-zora requested a review from ripel2 October 25, 2024 18:55
@ripel2 ripel2 changed the title Create Temporary component for optimization feat(core): create temporary component for optimization Oct 25, 2024
@ripel2 ripel2 changed the title feat(core): create temporary component for optimization feat(core): entity temporary components Oct 25, 2024
@ripel2 ripel2 merged commit 55da7c4 into main Oct 25, 2024
@ripel2 ripel2 deleted the temporary-component branch October 25, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants