Documentation Index
Fetch the complete documentation index at: https://mintlify.com/BunnyNabbit/celaria-formats/llms.txt
Use this file to discover all available pages before exploring further.
OrderedSet is a generic, insertion-ordered set used internally by celaria-formats to track the sequence of checkpoint blocks in a map. You access it through the checkpointOrder property on any parsed map instance — it is not exported from the main entry point directly.
The last block in checkpointOrder is treated as the goal block during serialization. When you call serialize() on a map, the library reads checkpointOrder.toArray() and uses the final element as the goal.
OrderedSet is not exported from celaria-formats’ main entry point (index.mjs). You interact with it only through map.checkpointOrder, which is an instance of OrderedSet<Block>.Example
Methods
add(element)
Adds an element to the set. If the element is already present, the call has no effect — the element’s position in the insertion order is unchanged.
add is idempotent with respect to order. Calling add on an element that is already in the set does not move it to the end — the original insertion position is preserved.The element to add. Type is generic — for
checkpointOrder this is a Block instance.void
delete(element)
Removes an element from the set.
The element to remove.
boolean — true if the element was present and removed, false if it was not in the set.
toArray()
Returns all elements in insertion order as a plain array.
Value[] — elements sorted by insertion order.
indexOf(element)
Returns the position of an element in the ordered array (0-indexed). Returns -1 if the element is not in the set.
The element to search for.
number — the 0-based index of the element, or -1 if not found.