-
Ultimately Im hoping there's a way to identify which entity the component currently belongs to, something theoretically like so: LocalFasterReadOnlyList<ExclusiveGroupStruct> groups = this.entitiesDB.FindGroups<Tree>();
foreach (var ((trees, count), groupId) in this.entitiesDB.QueryEntities<Tree>(groups))
{
for (uint i= 0; i< count; i++)
{
// Does the index map to the egid's entityId?
EGID entityId = new EGID(i, groupId);
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
sebas77
Jun 15, 2023
Replies: 1 comment
-
the entity ID of an entity is user chosen so in theory this would work if you choose to follow that logic. However what you wrote is not guaranteed, to know the id of the entity you need to change the deconstruction of the query to: foreach (var ((trees, entitiesID, count), groupId) in this.entitiesDB.QueryEntities<Tree>(groups))
{
for (uint i= 0; i< count; i++)
{
EGID entityId = new EGID(entitiesID[i], groupId);
}
} so it's engine to add an extra parameter in the deconstruction |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rettoph
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the entity ID of an entity is user chosen so in theory this would work if you choose to follow that logic. However what you wrote is not guaranteed, to know the id of the entity you need to change the deconstruction of the query to:
so it's engine to add an extra parameter in the deconstruction