|
interface unitsx
method life takes unit u returns real
method maxlife takes unit u returns real
method mana takes unit u returns real
method maxmana takes unit u returns real
method lv takes unit u returns integer
method strt takes unit u returns integer
method strf takes unit u returns integer
method agit takes unit u returns integer
method agif takes unit u returns integer
method intt takes unit u returns integer
method intf takes unit u returns integer
endinterface
struct Unit extends unitsx
method life takes unit u returns real
return GetUnitStateSwap(UNIT_STATE_LIFE, u)
endmethod
method maxlife takes unit u returns real
return GetUnitStateSwap(UNIT_STATE_MAX_LIFE, u)
endmethod
method mana takes unit u returns real
return GetUnitStateSwap(UNIT_STATE_MANA, u)
endmethod
method maxmana takes unit u returns real
return GetUnitStateSwap(UNIT_STATE_MAX_MANA, u)
endmethod
method lv takes unit u returns integer
return GetHeroLevel(u)
endmethod
method strt takes unit u returns integer
return GetHeroStr(u,true)
endmethod
method strf takes unit u returns integer
return GetHeroStr(u,false)
endmethod
method agit takes unit u returns integer
return GetHeroAgi(u,true)
endmethod
method agif takes unit u returns integer
return GetHeroAgi(u,false)
endmethod
method intt takes unit u returns integer
return GetHeroInt(u,true)
endmethod
method intf takes unit u returns integer
return GetHeroInt(u,false)
endmethod
endstruct
地图初始化时
globals
unitsx rs
endglobals
set rs = Unit.create()
然后我一直使用
call BJDebugMsg(R2S(rs.intt(GetAttacker())))
不用call rs.destory()
会有内存泄露吗? |
|