rj00a / evenio

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

Consider `World::send` returning back Event #61

Open andrewgazelka opened 4 months ago

andrewgazelka commented 4 months ago
pub fn send<E: Event>(&mut self, event: E) {

should perhaps be something like

pub fn send<E: Event>(&mut self, event: E) -> Option<E>

Or perhaps have a generic output on whether the event is immutable or not. This can be useful when sending an event from a World and wanting a response.


Do you think this is a good idea? Perhaps there is a more idiomatic way to do this, but I can't think of one that doesn't sacrifice in certain areas right now.

Norbiros commented 1 week ago

I really like this idea! It opens so many new possibilities.