2 Dimensional Arrays

SerraAvenger

Cuz I can
Reaction score
234
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.
This just didn't make any sense.
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.
 

Nestharus

o-o
Reaction score
84
This just didn't make any sense.

It does make sense... I'm saying you only need the features of a stack for this, lol... having the extra stuff that a dequeue comes with is kinda silly... =P.

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.

Kind of what I said, but I did [[unit, unit], instance] to spell. I said that an array with a counter would probably be a better choice than a stack given that = ).

Firstly, you need the [unit, unit], counter with an integer and then you need an array of instances that the unit is being used in.

For example, if unit a kills 50 units with spell b, then if that unit dies to unit 44, it should be removed from the other 49 units to keep the hashtable as clean as possible = ). You need an array of spells because unit 44 might be killed by unit a with spell b, c, and d, meaning that it'd get all 4 of those spells instead of just 1. The arrays can be indexed as their order doesn't really matter. If you don't use indexed arrays for that, you'll be forced to use a list so you can remove specific instances. For the spell array, you could either use a stack (kind of silly unless you are referencing a specific struct), or an array (store the spell ids into the hashtable).
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top