Viikuna
No Marlo no game.
- Reaction score
- 265
I need to know from which child struct this one static method was called.
I tried .getType() -method, but I couldnt get it work in static method.
I need something like this:
Is there some way to do something like this?
I tried .getType() -method, but I couldnt get it work in static method.
I need something like this:
JASS:
struct Parent
static method findInstance takes handle h returns Parent
local Parent this=0
if < SomeCondition is true > then
set this=GetStoredInteger(Cache, < child structs name >, I2S(H2I(h)))
endif
return this
endmethod
// some stuff
endstruct
struct Child1 extends Parent
// some stuff
endstruct
struct Child2 extends Parent
// some stuff
endstruct
function test takes handle h returns nothing
local Child1 a=Child1.findInstance(h)
local Child2 b=Child2.findInstance(h)
endfunction
Is there some way to do something like this?