- Joined
- Aug 7, 2013
- Messages
- 1,338
Hi,
I'd like to be able to map unit type ids (e.g. 'H001') to integer values. To simplify things I've made an integer array that maps integers to the unit type ids, but I'd also like to be able to go in the reverse, and I don't think it's possible with an array, as the indices would be too large.
Would it be as simple as just having a function that does it?
Or is there a better way to do this?
I'd like to be able to map unit type ids (e.g. 'H001') to integer values. To simplify things I've made an integer array that maps integers to the unit type ids, but I'd also like to be able to go in the reverse, and I don't think it's possible with an array, as the indices would be too large.
Would it be as simple as just having a function that does it?
JASS:
function foo takes integer a returns integer
if a == 'H001':
return 0
.
.
.
endfunction
Or is there a better way to do this?