Sorry for double post, just wanted to say the issue has been resolved.
I resolved to using:
Jass:
private interface I
real x
real y
integer count
integer playerId
trackable t
static trigger TrackEvent = CreateTrigger()
static trigger HitEvent = CreateTrigger()
method onTrack takes nothing returns nothing defaults nothing
method onHit takes nothing returns nothing defaults nothing
endinterface
private struct iTrack extends I
static method operator [] takes trackable t returns thistype
local thistype this = LoadInteger(customInventory.table, customInventory.trackableKey, GetHandleId(t))
return this
endmethod
static method operator []= takes trackable t, integer i returns nothing
call SaveInteger(customInventory.table, customInventory.trackableKey, GetHandleId(t), i)
endmethod
endstruct
private struct a extends iTrack
private method onHit takes nothing returns nothing
call BJDebugMsg("hit a")
endmethod
private method onTrack takes nothing returns nothing
call BJDebugMsg("tracked a")
endmethod
endstruct
private struct b extends iTrack
private method onHit takes nothing returns nothing
call BJDebugMsg("hit b")
endmethod
private method onTrack takes nothing returns nothing
call BJDebugMsg("tracked b")
endmethod
endstruct
private function Track takes nothing returns boolean
local iTrack dat = iTrack[GetTriggeringTrackable()]
if dat.t == null then
return false
endif
call dat.onTrack()
return false
endfunction
private function Hit takes nothing returns boolean
local iTrack dat = iTrack[GetTriggeringTrackable()]
if dat.t == null then
return false
endif
call dat.onHit()
return false
endfunction
__________________
Apheraz Lucent and -Grendel will forever live in my memory, two extraordinary persons taken away from our world before their time.
And so i dedicate my signature to them, a small sign of memory that will forever remain on my profile, for as long as it exists.
I am sad it's all i can do for them now and i hope i never did something to bring them anything but joy in their life.
World is a cruel place, but it was a better place with both of you in it. Miss you both.
|