SerraAvenger
Cuz I can
- Reaction score
- 234
This just didn't make any sense.You only need a stack as the stack can easily clear out, a list is totally unneeded for this >.<.. really, you don't even need a stack as you can store the spell Ids directly if you hash the handle ids to make the numbers smaller.
A stack is a data structure with lifo and usually a push and a pop operator
A list is a data structure (I guess it has some sort of specification, eg I don't think a tree would be a list, too).
Any stack is a list, but not any list is a stack.
Hence saying "use a stack, since you don't need a list" is quite much like saying "eat bananas, since you don't need fruit."
Apart from that, using the same data structure for multiple spells doesn't seem very good to me.
What I also don't get is how you want to register a unit killing another multiple times. Is there a way to revive a unit as such?
I think what you'll want to do is a simple map of [unit, unit] to spellChain, where spellChain is a double linked list member with information about your spell.
I still stand by my choice: Use PUI (or any similar system) to get two <8k indicies for the two units, return the double linked list element.