- Joined
- Sep 9, 2007
- Messages
- 6,759
Hey all. Basicly I want to make struct instances of a struct inside another.
Here is the example:
So, what x and y coordinates are used in the run function of the childrens?
And, what do I need to use the parents member?
So they can be called inside the children?
Protected?
I want to access to the parents value.
Thanks in advance.
Here is the example:
JASS:
struct Child
// The members
unit example
real x = 0.
real y = 0.
public method run takes nothing returns nothing
call SetUnitX(example, x)
call SetUnitY(example, y)
endmethod
endstruct
struct Parent
// The members
real x = 0.
real y = 0.
Child array childrens[8191]
integer index = 0
public method run takes nothing returns nothing
local integer i = 0
loop
exitwhen i > this.index
call this.childrens[i].run()
set i = i + 1
endloop
endmethod
endstruct
So, what x and y coordinates are used in the run function of the childrens?
And, what do I need to use the parents member?
So they can be called inside the children?
Protected?
I want to access to the parents value.
Thanks in advance.