rj00a / evenio

An event-driven Entity Component System
MIT License
132 stars 14 forks source link

Impl `HandlerParam` for `&World`, `&mut World` #60

Open andrewgazelka opened 4 months ago

andrewgazelka commented 4 months ago

Pros

Cons

rj00a commented 4 months ago

&World might be doable, but &mut World within a handler would lead to unsoundness. It would be possible to send an event for the currently running handler, causing mutable aliasing. You could also do things like remove handlers which would invalidate the iterator over the current HandlerList.