GetTriggerUnit-
DogEntrepreneur
- Reaction score
- 129
//for the above struct
call Test.TestStatic ()
call TimerStart (whichTimer, interval, periodicBool, function hello.periodic
struct main
static method onCast_Conditions takes nothing returns boolean
return ...
endmethod
static method onCast takes nothing returns nothing
...
endmethod
static method onInit takes nothing returns nothing
local trigger trig = Create Trigger()
call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_SPELL_EFFECT)
call TriggerAddCondition(trig,function thistype.onCast_Conditions)
call TriggerAddFunction(trig,function thistype.onCast)
endmethod
endstruct
//Alternatively:
private function Init takes nothing returns nothing
local trigger trig = Create Trigger()
call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_SPELL_EFFECT)
call TriggerAddCondition(trig,function main.onCast_Conditions)
call TriggerAddFunction(trig,function main.onCast)
endfunction
// Can you do this?
private static method ...
...
local thistype this = /* ?????? /*
should always be used inside a struct, at least in my opinion. Are you wondering what you should assign as value?JASS:local thistype this
private function Init takes nothing returns nothing
local trigger trig = Create Trigger()
call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_SPELL_EFFECT)
call TriggerAddCondition(trig,function main.onCast_Conditions)
call TriggerAddFunction(trig,function main.onCast)
endfunction
library arbitrary initializer Init
private function Init takes nothing returns nothing
local trigger trig = Create Trigger()
call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_SPELL_EFFECT)
call TriggerAddCondition(trig,function main.onCast_Conditions)
call TriggerAddFunction(trig,function main.onCast)
endfunction
endlibrary
But I find it kinda useless, it takes more time than a normal function...