I HAVE to make a method that calls ANY function fed. It takes a code call back, which calls the function after the loop.
From the code above i wish i'm making myself somewhat clear ..
below is the starting method:
and my call function
Is there any other way for me to call a function from outside a library? Because in the case above I kept it in a struct (variable array also does nothing) to be called later... Even PRO IDEAS are well accepted(and i'm eager to learn) for i badly need this for my system
JASS:
static method loopthis takes nothing returns nothing
//actions here~~~
loop
exitwhen i>=f.counter
if f.this >= f.that then
//actions~~~
else
//Here's the thing I mean
if not (f.cb == null) then
call f.cb()
endif
//actions~~~
From the code above i wish i'm making myself somewhat clear ..
below is the starting method:
JASS:
static method values takes unit u, real h, code cb returns nothing
local SomeFunc f = f.allocate()
//blah~~
set f.cb = cb
//indexer here
endmethod
and my call function
JASS:
private function Actions takes nothing returns nothing
//local block
//actions block
call SomeFunc.values(caster, GetUnitFlyHeight(caster), function dmgtarget(caster, tgt, lvl) //dmgtarget is NOT a private func
Is there any other way for me to call a function from outside a library? Because in the case above I kept it in a struct (variable array also does nothing) to be called later... Even PRO IDEAS are well accepted(and i'm eager to learn) for i badly need this for my system