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
This is an idea for now, but I plan to experiment around it.
The idea would be that from now on Systems have names like so:
-- System definition with a namelocalRenderSystem=System("Render", {pool= {"position", "texture"}})
-- Event definitionfunctionRenderSystem:draw ()
for_, entityinipairs(self.pool) dolove.graphics.draw(entity.texture.image, entity.position.x, entity.position.y)
endend
Now to emit the draw event we would usually call it like this
World:emit('draw', ...)
But this may also call other Systems that also define draw, if we only intended to call draw on the Render system we have no way to do so, with my proposal we would now call it like so:
World:emit('Render.draw', ...)
This means that now you have a way to call an event for a given System without calling events on other systems that may accidentally share the same name.
We can still target multiple systems if we don't specify the system name like so:
World:emit('draw', ...)
This makes the change backwards compatible, except for the addition of names for systems (which may also help with a debugger if we make one)
The text was updated successfully, but these errors were encountered:
beforeEmit and afterEmit are fairly new and I expect more users to not use them in their code yet, plus the change is fairly small anyways so this shouldn't be a blocker to roll this feature out.
This is an idea for now, but I plan to experiment around it.
The idea would be that from now on Systems have names like so:
Now to emit the draw event we would usually call it like this
But this may also call other Systems that also define draw, if we only intended to call
draw
on theRender
system we have no way to do so, with my proposal we would now call it like so:This means that now you have a way to call an event for a given System without calling events on other systems that may accidentally share the same name.
We can still target multiple systems if we don't specify the system name like so:
This makes the change backwards compatible, except for the addition of names for systems (which may also help with a debugger if we make one)
The text was updated successfully, but these errors were encountered: