• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Usage of ArrayList in Jass?

Status
Not open for further replies.
Level 16
Joined
Feb 22, 2006
Messages
960
today i had too much freetime... so I started working on an ArrayList System
which can store objects (in this case structs). the arraylist itself is a struct (so you better can handle it like a normal variable) but it stores the objects in a global.

So do you think such a system could be usefull?

You would not have to attach structs to any handles, you just could store them and use them later

JASS:
globals
     private ArrayList blub
endglobals

function didu takes nothing returns nothing
     set blub = ArrayList.create(100) //creates an ArrayList with 100slots
     call blub.add(0,anystruct) //0 = index
endfunction

this would look equal to that...
so wirte down what you think, or just flame me since i get such awful ideas^^
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
543
you could use the [] operator instead of the ugly .add(<index>, <data>).
And you should only write those list to learn because we already have dary and linked lists.
 
Status
Not open for further replies.
Top