You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi -- This library looks really nice and well-designed, I'm trying it out in a game!
One question: why are component properties always wrapped in getter/setter functions, even though the manager isn't an event emitter?
If the intent is that the user can optionally add a manager.emit function, wouldn't it make sense to make getter/setter wrapping optional to avoid overhead in the default case?
E.g.:
EntityManager.prototype.addComponentsToEntity = function (
componentIds,
entityId,
wrapWithGetterSetters=false) {
or the like?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi! Thanks for using it, I'm looking forward to seeing what you will do with it.
The intent you state is correct, and you are right that it is not optimal. However, on the solution side, I think we can simply check if manager.emit is a function before making getters/setters, and just not make them if it isn't. That means adding an emit function to a manager after declaring some components won't emit anything, but I don't expect that people will do do those sorts of things, and we can always say it's a feature... :)
Hi -- This library looks really nice and well-designed, I'm trying it out in a game!
One question: why are component properties always wrapped in getter/setter functions, even though the manager isn't an event emitter?
If the intent is that the user can optionally add a
manager.emit
function, wouldn't it make sense to make getter/setter wrapping optional to avoid overhead in the default case?E.g.:
or the like?
Thanks!
The text was updated successfully, but these errors were encountered: