fabio-t / alone-rl

A free to use, survival open-world roguelike game
GNU Affero General Public License v3.0
38 stars 2 forks source link

Use IntSet for entity grid contents #5

Closed fabio-t closed 8 years ago

fabio-t commented 8 years ago

For the use we do, IntSet is much better than the IntList to store the IDs of the entities within a certain grid.

We both iterate over the elements often, but also add/remove. O(1) add and remove are gold.

If I need to keep the order of the inserted elements (I'm pretty sure I don't, but IF), I can use the implementation IntLinkedOpenHashSet.