luorax
Invasion in Duskwood
- Reaction score
- 67
Okay, I have a question:
How can I use array variables in a sruct which extends array? I have an AIDS struct which contains various datas about the questgiver units, and I need array members in it. I'm using two struct to achieve it, but what's your opinion? I don't want to use dynamic arrays, because their limitations.
This is a part of my script:
But what else should I do to improve it?
How can I use array variables in a sruct which extends array? I have an AIDS struct which contains various datas about the questgiver units, and I need array members in it. I'm using two struct to achieve it, but what's your opinion? I don't want to use dynamic arrays, because their limitations.
This is a part of my script:
JASS:
private struct QuestGiverData
effect array SFX[12]
private method onDestroy takes nothing returns nothing
local integer li = 0
loop
exitwhen li > 11
call DestroyEffect(.SFX[li])
set .SFX[li] = null
set li = li + 1
endloop
endmethod
endstruct
private struct QuestGiverStruct extends array
readonly QuestGiverData Data
method AIDS_onCreate takes nothing returns nothing
set .Data = QuestGiverData.create()
endmethod
static method AIDS_filter takes unit u returns boolean
return GetOwningPlayer(u) == QUEST_PLAYER_1 or GetOwningPlayer(u) == QUEST_PLAYER_2
endmethod
method AIDS_onDestroy takes nothing returns nothing
call .Data.destroy()
endmethod
//! runtextmacro AIDS()
endstruct
But what else should I do to improve it?