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
To decouple code and outsource logic using events, Arch.Extended has the EventBus. The special feature here, it is completely source generated and therefore as fast as native method calls. And it can even be inlined and supports static classes and instances.
Code sample
publicpartialclassMyInstanceReceiver{publicMysInstanceReceiver(){Hook();}// To start listening.[Event(order...)]publicvoidOnShootEvent(refShootEvent@event){// Handle}
... Other event receiving methods}publicstaticclassSomeEventHandler{[Event(order: ...)]publicstaticvoidOnShootFireBullets(refShootEventevent){// ref, none, in supported and all types as a event. Only one param!// Do stuff}
...}varshootEvent= ...;EventBus.Send(refshootEvent);// Broadcasts the event to all annotated static methods wherever they are.