If I want to have, say, a damage detection system that registers functions and only checks the functions that are registered, how should I go about doing that? Ignore doing anything for damage detection, I just want to be able to register functions to a trigger so that I am not duplicating events everywhere.
My current idea is to create triggers and manage an array of triggers. The damage system (or whatever other system) would then run all of the triggers when one of its events fires. The triggers that I add to the system will have no events. I am basically using them as function pointers.
I would use
since I have read that it is faster than
.
Is there a better way to do this or is this on the right track?
Note: I use default WC3 editor but I am using JASS for everything.
My current idea is to create triggers and manage an array of triggers. The damage system (or whatever other system) would then run all of the triggers when one of its events fires. The triggers that I add to the system will have no events. I am basically using them as function pointers.
I would use
JASS:
call TriggerEvaluate(trig)
JASS:
call TriggerExecute(trig)
Is there a better way to do this or is this on the right track?
Note: I use default WC3 editor but I am using JASS for everything.