- Joined
- Mar 21, 2011
- Messages
- 1,611
Hi guys,
i want to create structs that extend a certain type. It has predetermined functions, and i want them to trigger on certain events. However, it doesnt work this way. Any ideas how i could realize that?
i want to create structs that extend a certain type. It has predetermined functions, and i want them to trigger on certain events. However, it doesnt work this way. Any ideas how i could realize that?
JASS:
interface i
method onCast takes nothing returns nothing
endinterface
struct s extends i
method onCast takes nothing returns nothing
endmethod
endstruct
function cast
call s_instance.onCast
endmethod
private function Init
call TriggerRegisterUnitEvent(EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction
JASS:
struct test extends s
method onCast takes nothing return nothing
//... do stuff when casting an ability
endmethod
endstruct