❔ Help with Action syntax for event handler system
I am trying to add a basic event system to my program and would like the syntax to be something like this:
Ideally there is no need for a baseclass or interface. All that should be needed is for the function passed as an action to take the event type as an argument.
I have the following implmentation for the registration:
I would very much like the register syntax to be like this:
but I struggle with how to achive this, and I am not entirely sure if its possible?
Ideally there is no need for a baseclass or interface. All that should be needed is for the function passed as an action to take the event type as an argument.
I have the following implmentation for the registration:
I would very much like the register syntax to be like this:
but I struggle with how to achive this, and I am not entirely sure if its possible?