Will be called each time an event of type E is emitted.
@event struct MyEvent { int data; } class MySystem : IReceiver!MyEvent { this(EventManager evtManager) { evtManager.subscribe!MyEvent(this); } void receive(MyEvent event) { import std.stdio : write; // do something with event write(event.data); } }
Any receiver class needs to derive from this interface using a specific event type and implement receive.