- Joined
- Apr 27, 2008
- Messages
- 2,455
I don't have the use for it, because if i need a dynamic event i would just use a dynamic trigger and don't have use of "data", but nevermind you don't have to convince me, i've just found something lame imho.
Since you are using LinkedListModule, and especially the method insertNode, which for some reason is actually reverting the relative order (i mean i don't know why Dirac has chosen this way), you would use "prev" instead of "next" in you fire method.
Because with this sample :
The expected messages are "F1" and then "F2", not the opposite.
Ofc that probably doesn't matter that much, but i think it makes more sense this way.
Since you are using LinkedListModule, and especially the method insertNode, which for some reason is actually reverting the relative order (i mean i don't know why Dirac has chosen this way), you would use "prev" instead of "next" in you fire method.
Because with this sample :
JASS:
scope Test initializer init
private function F1 takes nothing returns nothing
call BJDebugMsg("F1")
endfunction
private function F2 takes nothing returns nothing
call BJDebugMsg("F2")
endfunction
private function init takes nothing returns nothing
local Advent ev = Advent.create()
call ev.registerEx(function F1)
call ev.registerEx(function F2)
call ev.fire()
endfunction
endscope
The expected messages are "F1" and then "F2", not the opposite.
Ofc that probably doesn't matter that much, but i think it makes more sense this way.