- Joined
- Oct 11, 2012
- Messages
- 711
A dump question: what does Unit Indexer do? To help make a spell MUI? :/
It gives every unit a unique number, an integer. It sets the custom value of a unit. No other unit has the same number. You can use the number as an index in arrays. So yes, it helps making a spell MUI.
It indexes unit; it maps a value (integer) to a unit.
Let's say we have 2 units, footman(0x01) and footman(0x02), we then tell the Unit indexer to index 0x02, it gives it the id 100. Then we index 0x01 too, the indexer assigns 900 to it. Now, whenever we fetch the integer index for the said unit, it will always return a unique, constant integer index. You can then use that index as an array index (or a struct instance id or slot) for your spells and you won't need to worry about collisions (array index collisions).
I hope you got that, I'm bad at explaining.
1. Handle ID's can't be used raw on arrays, its values are too high.
2. That depends on the Unit Indexer library you are using. (system API)
https://github.com/HiveWorkshop/JASS-Code/blob/master/Unit Indexer/!! readme.txt
https://github.com/HiveWorkshop/JASS-Code/blob/master/Unit Indexer/!! documentation.txt
1st explains what a unit indexer is and compares the big 3
2nd documents the API of THW's unit indexer