I'm currently considering how i might approach a parameter based event management system.
My aim is to build it such that the actions that are executed on a particular event are able to be dynamic. This would essentially extend the event system that is used for input control, however my aim is to use a lot less case statements.
My initial thought was to build up a couple of string based maps so that parameters may be allocated against events, for example:
actionMap["onCollision"] = "doDestroy"
FunctionMap["doDestroy"] = <pointer reference to function to execute for destroying an object>
allowing for other parts of the code to call,
I've already encountered some pitfalls with this approach, particularly the catches with using function pointers, and void* variables, and was curious to see what other people were doing in this kind of case?
Is there any real advantage in doing this compared to say, case statements against variables? Noting I'm hoping to have a few thousand objects at a time.