Executor
I see you
- Reaction score
- 57
Hi,
actually I think this should be a really simple problem with a really simple solution but somehow it doesnt work.
I want to loop through all kinds of Bases, but access the methods of their childs. The question is, how do I declare such a method in the parent struct, so that the child creation 'replaces' the method implementation of the parent instance via the index they share.
I hope I could make my problem understandable.
Greetings
actually I think this should be a really simple problem with a really simple solution but somehow it doesnt work.
JASS:
struct Base
// ?
endstruct
struct Kind1 extends Base
method processMoveOrder takes destination returns integer
// implementation
endmethod
endstruct
struct Kind2 extends Base
method processMoveOrder takes destination returns integer
// implementation
endmethod
endstruct
function someFunc takes nothing returns nothing
local Base f = 0
loop
exitwhen f == someNumber
if f.processMoveOrder(someDestination) > 0 then
return
endif
set f = f + 1
endloop
return
endfunction
I want to loop through all kinds of Bases, but access the methods of their childs. The question is, how do I declare such a method in the parent struct, so that the child creation 'replaces' the method implementation of the parent instance via the index they share.
I hope I could make my problem understandable.
Greetings