Hey guys,
i'm struggling with a (probably) very simple problem. I try to create a buff module that calls a method periodically. As long as i don't implement the module, JassHelper will compile, but as soon as i want to use it, it will throw an error: "this" is not a type that allows . syntax. I'm wondering why that is..
i'm struggling with a (probably) very simple problem. I try to create a buff module that calls a method periodically. As long as i don't implement the module, JassHelper will compile, but as soon as i want to use it, it will throw an error: "this" is not a type that allows . syntax. I'm wondering why that is..
JASS:
module Buff
string icon
string name
string description
real duration
real interval
// ...
timer periodictimer
static method callPeriodicBuff takes nothing returns nothing
local thistype this = GetTimerData(GetExpiredTimer())
call this.periodic()
endmethod
method onEnd takes nothing returns nothing
// ...
endmethod
method onInterval takes nothing returns nothing
// ...
endmethod
method onStart takes nothing returns nothing
// ...
endmethod
method periodic takes nothing returns nothing
// ...
endmethod
static method create takes nothing returns thistype
local thistype this = thistype.allocate()
set periodictimer = NewTimer()
call SetTimerData(periodictimer, this)
call TimerStart(periodictimer, 0.1, true, function thistype.callPeriodicBuff)
return this
endmethod
method destroy takes nothing returns nothing
// ...
endmethod
endmodule
/*struct s
implement Buff
endstruct*/