okay say I have a type
type something
field mesh
field locx
field locy
end type
Then I make an array of these types.
dim myarray.something(10)
dim player.something(5)
Then say I wanted to copy myarray.something(4) -> player.something(3)
Meaning I want all the fields that have been initialized earlier, say I had a function taht went through myarray and init'd all the variables for each array element.
and I wanted to copy the whole array element position 4, all the fields and their values etc.. to player array element 3. so that player array element 3 contains all the fields and values from myarray(4).
So what I want to know is, can I use
player(3) = copyentity(myarray(4))
Will this work like I want it to, copying all fields etc.. ? If not, I guess I will just have to manually copy the fields, I was just trying to make a shortcut, by copying the whole entity fields and all, then only changing the fields that need to be changed, to make the code shorter.
type something
field mesh
field locx
field locy
end type
Then I make an array of these types.
dim myarray.something(10)
dim player.something(5)
Then say I wanted to copy myarray.something(4) -> player.something(3)
Meaning I want all the fields that have been initialized earlier, say I had a function taht went through myarray and init'd all the variables for each array element.
and I wanted to copy the whole array element position 4, all the fields and their values etc.. to player array element 3. so that player array element 3 contains all the fields and values from myarray(4).
So what I want to know is, can I use
player(3) = copyentity(myarray(4))
Will this work like I want it to, copying all fields etc.. ? If not, I guess I will just have to manually copy the fields, I was just trying to make a shortcut, by copying the whole entity fields and all, then only changing the fields that need to be changed, to make the code shorter.