- Joined
- Sep 18, 2011
- Messages
- 195
Hi,
I have a noob question since I am learning vJass...
1. can struct components names be the same arguments for the static method create?
2. Can someone explain to me how to attach a handle to the struct instance to a unit
Because I am not sure what to use here, a timer or what, since the instance will last forever...
And how will I manage the handle variable through GUI?
3. Is there anything wrong in my beginning code ?
If there are vJass systems I should import then it is ok
I have a noob question since I am learning vJass...
1. can struct components names be the same arguments for the static method create?
2. Can someone explain to me how to attach a handle to the struct instance to a unit
Because I am not sure what to use here, a timer or what, since the instance will last forever...
And how will I manage the handle variable through GUI?
JASS:
struct bomb
real t
unit u
static method create takes unit u, real t returns thistype
local thistype new = thistype.allocate()
set new.u = u
set new.t = t
return new
endmethod
method move takes real a returns nothing
set this.t = this.t - a
endmethod
endstruct
function createBomb takes unit u, real t returns nothing
local bomb new = bomb.create(u,t)
// ? attach ?
endfunction
function moveBomb takes unit u, real a returns nothing
// local bomb h = ? get u handle ?
call h.move(a)
endfunction
3. Is there anything wrong in my beginning code ?
If there are vJass systems I should import then it is ok
Last edited: