• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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
539
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