Collections

There’s a bunch of collection types available in SwissArmyLib, mostly just used internally but perhaps someone might find them useful.

Class Purpose
Grid2D<T> A fixed (but resizable) 2D grid of items.
Grid3D<T> Same as Grid2D<T> but with an extra axis.
PooledLinkedList<T> A wrapper for LinkedList<T> that recycles its LinkedListNode<T> instances to reduce GC allocations.
DelayedList<T> A list wrapper that delays adding or removing item from the list until its method ProcessPending() is called. Useful to avoid problems when you want to be able to add or remove from a list in the midst of iterating through it.
PrioritizedList<T> A list where the items are kept sorted by their priorities.
DictionaryWithDefault<TKey,TValue> Just a regular Dictionary<TKey,TValue> but instead of throwing an error when a key doesn’t exist it just returns a specified default value.