the Immortal
I know, I know...
- Reaction score
- 51
Ynow, after we (in fact 'you') had that discussion about a global GROUP, isn't it time for a global hashtable, lols? =P
No, apart from the jokes, there are many spells where only one row (column) of the hashtable is needed. Should I post some links? Though am sure everyone can find. So instead of making the user paste some indexing/attaching system (be it unit, trigger, timer or w/e.. plus you can -always- make it optional) or needlessly create tens of hashtables only to use a single key or two of them, why isn't something as simple as that implemented?:
And when you want to use it, just create a public key and.. voilà?
So this
becomes this:
Actually for me it doesn't matter if I have 1000 hashtables or only one, as the speed difference should be.. negligible. But since it seems to be a problem, I am putting it here for discussing.. without much hopes to accomplish anything btw =D
Nothing's wrong with unit indexing / attaching, of course.. but I hate having to paste a whole system only for a single spell to work. As, I think, most of the time happens.
Make these optional, use hashtables. Or better - use a single hashtable.
No, apart from the jokes, there are many spells where only one row (column) of the hashtable is needed. Should I post some links? Though am sure everyone can find. So instead of making the user paste some indexing/attaching system (be it unit, trigger, timer or w/e.. plus you can -always- make it optional) or needlessly create tens of hashtables only to use a single key or two of them, why isn't something as simple as that implemented?:
JASS:
library_once HASH
globals
hashtable HASH //damn silly name, but we have 'GROUP' so diaf!
endglobals
endlibrary
And when you want to use it, just create a public key and.. voilà?
So this
JASS:
scope SomeSpell
globals
hashtable ht
endglobals
function onCast takes nothing returns nothing
local data d = LoadInteger(ht, 0, GetHandleId(GetTriggerUnit()))
...
endfunction
...
endscope
becomes this:
JASS:
library_once HASH
globals
hashtable HASH //damn silly name, but we have 'GROUP' ?
endglobals
endlibrary
scope SomeSpell requires HASH
globals
public key UNITID_ROW //another silly name, out of ideas today
endglobals
function onCast takes nothing returns nothing
local data d = LoadInteger(HASH, UNITID_ROW, GetHandleId(GetTriggerUnit()))
...
endfunction
...
endscope
Actually for me it doesn't matter if I have 1000 hashtables or only one, as the speed difference should be.. negligible. But since it seems to be a problem, I am putting it here for discussing.. without much hopes to accomplish anything btw =D
Nothing's wrong with unit indexing / attaching, of course.. but I hate having to paste a whole system only for a single spell to work. As, I think, most of the time happens.
Make these optional, use hashtables. Or better - use a single hashtable.