Skip to content

Understanding group component ownership. #829

Answered by skypjack
njmayes asked this question in Q&A
Discussion options

You must be logged in to vote

Is the second group allowed to own the transform component?

Unfortunately no, the registry owns the groups and extends their lifetime.
However, my two cents: use a view until you know that you've a bottleneck, than switch to a group. Far easier to reason about in the long term.

Secondly, is creating the group and iterating each game loop a reasonable way to implement this?

Group creation is super cheap (but for the first time and only if the registry already contains thousands and thousands of entities and components). You don't have to store them aside.

Are the iterators for the group created upon group creation, or can I add and remove components owned by the group and still be abl…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@njmayes
Comment options

Answer selected by njmayes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question open question
2 participants