AbstractGuiList

abstract class AbstractGuiList<T, out L : List<T>>(collection: L)(source)

Parent class of the immutable GuiList and mutable GuiMutableList.

Inheritors

Constructors

Link copied to clipboard
constructor(collection: L)

Functions

Link copied to clipboard
fun invokeListeners(): Job

Invokes all listeners, causing all open guis using this list to update.

Link copied to clipboard
inline suspend fun <R> lookup(block: (List<T>) -> R): R

Provides access to the internal collection in an immutable form. Please do only use the collection inside the block lambda, as only there thread-safety can be guaranteed.

Link copied to clipboard
fun onChange(block: suspend (List<T>) -> Unit)

Registers an onChangeListener, which will be called if the content of this list is mutated.

Link copied to clipboard
fun removeOnChangeListener(block: suspend (List<T>) -> Unit)

Unregisters an already registered onChangeListener.