- Joined
- Nov 30, 2007
- Messages
- 1,202
Yes you heard that right... I need a sytem that assigns an unique level to abilities as units enter the map, when the unit is deindexed it must recycle the available level. The purpose is to be able to determine which tooltip has been assigned to which unit / player-unit to make changes MUI.
I'm thinking the API would be something like this:
When the unit enters the map one would loop through all abilities added via "addAbility" to see if the unit has such an ability level greater than 0. Than it would be given it's index between 1 - MaxLevel.
- The system must take into account the maximum level that the ability can take (if possible) and print an error if it's full.
- There could be a constant to toggle between global indexing of levels and player indexing of levels, meaning each player has their own index.
- It doesn't matter to me if the indexes maintains order or if the index fragments as long as the levels can be recycled correctly.
I'm thinking the API would be something like this:
JASS:
static method addAbility(AbilCode, MaxLevel) returns nothing // setup
static method sharedIndex(AbilCode, MaxLevel) returns integer
static method playerIndex(Player, AbilCode, MaxLevel) returns integer
static method sharedDeindex(AbilCode, Level)
static method playerDeindex(Player, AbilCode, Level)
static method handlesAbility(AbilCode) returns boolean // checks if an ability is handled by the system
When the unit enters the map one would loop through all abilities added via "addAbility" to see if the unit has such an ability level greater than 0. Than it would be given it's index between 1 - MaxLevel.
Last edited: