What is the most proper way to get a reference to my GameEntity in this scenario?
Say I have a query like this:
isNewPlayer: {
components: [ PlayerEntityTagComponent ],
listen: { added: true }
}
And a query handler like this:
this.queries.isNewPlayer.added.forEach(playerEntity => {
// TODO: get existing gameEntity so I can add playerEntity to the gameEntity's PlayerListComponent
})
How should I get the game entity from ECSY? I have it named ‘game’ but there is no method publicly exposed to get an entity by name.
Is there a better way to arrange this code or am I just missing something?