The_Kingpin
Member (Who are you and why should I care?)
- Reaction score
- 41
When you create a new instance of the struct with the .create method.
When you create a new instance of the struct with the .create method.
Why would you make another instance of exactly the same thing? And how can you change that instance if need be?
A.create()
local A s = A.create() //{local integer s.a, local integer s.b, local integer s.c}
struct Spell
unit Caster
unit Target
method Damage takes nothing returns nothing
call UnitDamageTarget(this.Caster,this.Target,...)
endmethod
endstruct
function Trig_Spell_Timeout takes unit u returns nothing
local Spell s = GetHandleInt(u,"something") //Get the struct from the unit and do actions.
call s.Damage()
call s.destroy()
endfunction
function Trig_Spell_Actions takes nothing returns nothing
local Spell s = Spell.create() //Creates a new structure of data from Spell.
set s.Caster = GetSpellAbilityUnit()
set s.Target = GetSpellTargetUnit()
call SetHandleInt(GetSpellTargetUnit(),"something",s) //Attach the struct to the target.
endfunction
just a question what does making it static will give me that i don't have in a none static value?