Skip to content

How to best deal with modular architecture and rigid entity descriptors? #87

Answered by Grigler
tobiasaxenbeck asked this question in Q&A
Discussion options

You must be logged in to vote

Using ExtendibleEntityDescriptor is likely the best way to handle this rather than having all components on all entities, as it allows you to group common sets of components easily. Though I would still separate unique descriptors into separate groups (so their components align), your engines would be able to still operate on common sets of components by using the following syntax which would allow you to keep common behaviour generic and avoid the composite group permutations you decribed.

var groups = entitiesDB.FindGroups<SomeComponent>();
foreach(var ((componentsNB, count), group) in entitiesDB.QueryEntities<SomeComponent>(groups))
{
  // your logic
}

It's also worth noting that entit…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by sebas77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
FAQ Svelto FAQs
3 participants