-
Notifications
You must be signed in to change notification settings - Fork 1
LinkedList
Jump To | Go Back |
Methods | Variables |
---|
Implements: IterableList
A GML-based linked list data structure. Can be used as a garbage-collected replacement for the built-in ds_list.
Jump To | top |
index | next | previous | push | insert | replace | pop | clear | size |
---|
Returns: mixed
Throws: IndexOutOfBounds
Name | Type | Purpose |
---|---|---|
index | int |
The position to read from |
Reads the value at the given index in the list. If the index is out of range an IndexOutOfBounds will be thrown.
Returns: mixed
or EOL
Name | Type | Purpose |
---|---|---|
None |
Seeks the next value in the list after the last read position, or EOL if the list has been fully traversed. Can use index() to set the next read position.
Name | Type | Purpose |
---|---|---|
None |
Seeks the previous value in the list before the last read position, or EOL if the front of the list has been reached. Can use index() to set the next read position.
Returns: self
Name | Type | Purpose |
---|---|---|
*values... | mixed |
One or more values |
Adds the given values to the end of the list
Returns: self
Throws: IndexOutOfBounds
Name | Type | Purpose |
---|---|---|
index | int |
The position to insert at |
value | mixed |
The value to be inserted |
Inserts the value at the given index in the list. If the index is out of range an IndexOutOfBounds will be thrown.
Throws: IndexOutOfBounds
Name | Type | Purpose |
---|---|---|
index | int |
The position to write to |
value | Mixed | The value to write |
Writes the value to the given index in the list. If the index is out of range an IndexOutOfBounds will be thrown.
Returns: mixed
Throws: IndexOutOfBounds
Name | Type | Purpose |
---|---|---|
*index | int |
If provided, the value will be 'popped' from this position |
Removes an entry from the list and returns its value. If an index is provided it will remove and return that item, otherwise it will look for the last entry in the list. If the index is out of range, or the list is empty, an IndexOutOfBounds will be thrown.
Name | Type | Purpose |
---|---|---|
None |
Clears the list
Returns: int
Name | Type | Purpose |
---|---|---|
None |
Returns the size of the list
Jump To | top |
---|
Name | Type | Initial | Purpose |
---|---|---|---|
pool | undef |
new ObjectPool() | No description. |
__First | struct |
undefined | A pointer to the first item in the list |
__Last | struct |
undefined | A pointer to the last item in the list |
__Index | struct |
undefined | A pointer to the last item traversed in the list |
__Size | int |
0 | The size of the list |
Devon Mullane 2020