• 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.

[Snippet] Unit List

Then what is it used for? xD It seems just like a big group of units to me, but the only difference is that has order. (of ID's) And that it is ordered in a list. In big maps, this seems like it may grow concerns for the op-limit.

Unless I am still not following it, in which case I need an example to understand its purpose more. =P
 
oh, I made it for iterating through all indexed units in the map. When I made UnitRegen or w/e, I needed a way to iterate (actually, I made 2 scripts that needed iteration, so I abstracted the code to a separate resource).

I could add a group as well if you like. You might hit op limit if you loop over 6000 units 3x, lol, so yea, a group could be useful ^)^.
 
->Why is there a group for all units?

Multiple iterations

You should throw this into UnitIndexer because UnitIndexer already has a list for indexed units (the one that you appear to just "throw away" right after initialization).

I could make this an extension I guess, but that'd get so sloppy ;\. Oh well, give me a bit and I'll make it an extension library.

edit
Nah, the UnitIndexer list is optimized specifically for the adding to the list before game starts. Actually, nvm, give me a bit.

edit
updated
 
Using unit groups would be worse lol :p

ForGroup does the same thing that iteration does, but it's slower cause it has to create a new thread for each unit, run it, start the next thread, run it, etc..
Iteration is the same, but it doesn't have as much overhead as putting the units in a group and calling ForGroup.

Iteration = ForGroup() - (Overhead of function call + 1 thread per unit)
 
Top