The comfortable framework for making games in Wren
The collections module has a few useful “abstract data types” which can serve a variety of purposes.
They enforce additional semantics on Wren’s List and Map datatypes to achieve particular properties.
It contains the following classes:
Certain collections in this module use hashing to store values efficiently. But this means that tthe keys used are actually hashable types.
By default, this means you can only store:
nullYou can store more complex types if the object supports DOME’s Hashable interface.
hash(): Num | String | Boolean | Range | ClassThis method hashes the object in some unique fashion.
It can return any hashable type for use in Set.
Implements Sequence
This is like Wren’s built-in Map, but it works with keys that support DOME’s Hashable
interface, such as Vector.
new(): HashMapCreates a new HashMap.
count: NumReturns the total number of values stored in the HashMap.
isEmpty: NumReturns true if there are no values stored in the HashMap.
keys: SequenceReturns a sequence of all the keys stored in the HashMap.
values: SequenceReturns a sequence of all the values stored in the HashMap.
entries: Sequence<MapEntry>Returns a sequence of MapEntry, which holds key-value pairs contained in the HashMap.
clear()Clears all values from the HashMap.
containsKey(key: Hashable): BooleanReturns true if there is a value stored using the provided key.
has(key: Hashable): BooleanSame as containsKey but shorter for convenience
[key: Hashable]: AnyRetrieves the value matched to key in the HashMap. 
If there is no corresponding value, null is returned.
[key: Hashable]=(value)Stores value matched to key in the HashMap. 
If there is already a corresponding value for key, it is overwritten.
Implements Sequence
Like a queue in real life, the queue in DOME enforces a “First-in-First-out” (FIFO) ordering to elements added to it.
You cannot insert an element in the middle of the queue, only at the end. In addition, you can only view and retrieve 
the element at the front of the queue.
Queue implements Wren’s iterator protocol so you can traverse it using a for-loop.
new(): QueueCreates a new queue.
isEmpty: BooleanReturns true if the queue is empty (aka count == 0).
count: NumThe number of elements in the queue.
add(v: any)Place v at the end of the queue.
peek(): anyReturns the element at the front of the queue.
remove(): anyRemoves the element at the front of the queue, and returns it.
Implements Sequence
A priority queue is a collection where elements can be added to the queue in any order (with a priority supplied), but elements can only be retrieved in priority order.
new(): PriorityQueuemin(): PriorityQueueCreates a new queue where the lowest priority is served first.
max(): PriorityQueueCreates a new queue where the highest priority is served first.
new(comparator: Fn<a: Any, b: Any>: Boolean): PriorityQueueCreates a new queue which uses the given comparator to sort its elements.
isEmpty: BooleanReturns true if the queue is empty (aka count == 0).
count: NumThe number of elements in the queue.
toList: List<Any>Returns a List with all the contained elements in the current order.
add(v: any)Place v in the queue. The value v itself is used for priority comparison.
add(v: any, priority: any)Place v in the queue. The value priority is used for priority comparison.
peek(): anyReturns the element at the front of the queue.
remove(): anyRemoves the element at the front of the queue, and returns it.
Implements Sequence
A Set is an unordered collection which can only contain an element once. 
The items placed in the set must be Hashable
Set implements Wren’s iterator protocol so you can traverse it using a for-loop.
new(): SetCreates a new set.
isEmpty: BooleanReturns true if the set is empty (aka count == 0).
count: NumThe number of elements in the set.
add(v: any)Place v in the set. The value v itself is used for priority comparison.
has(v: any): BooleanReturns true if the set contains v.
get(v: any): anyIf the set contains v, it is returned.
remove(v: any): anyRemoves the element v from the set, and returns it.
Like a stack in real life, the stack in DOME enforces a “Lass-in-first-out” (LIFO) ordering to elements added to it.
You cannot insert an element in the middle of the stack, only at the top. In addition, you can only view and retrieve 
the element at the top of the stack.
Stack implements Wren’s iterator protocol so you can traverse it using a for-loop.
new(): StackCreates a new stack.
isEmpty: BooleanReturns true if the stack is empty (aka count == 0).
count: NumThe number of elements in the stack.
add(v: any)Place v at the end of the stack.
peek(): anyReturns the element at the front of the stack.
remove(): anyRemoves the element at the front of the stack, and returns it.
list(): List<Any>Returns a List with all the contained elements in the current order.