ActionRegistry

Class responsible for runtime-persisting actions and associating them with names and predicates.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
class Entry @JvmOverloads constructor(action: Action, situationOverrides: Map<Action.Situation, Action> = emptyMap(), predicate: ActionPredicate? = null)

An entry in the action registry, holding the action, its overrides, and its predicate.

Properties

Link copied to clipboard

Gets the set of all unique action entries that are currently registered.

Functions

Link copied to clipboard

Gets an action entry for a given name.

Link copied to clipboard

Registers a new Entry with one or more names.

fun registerEntry(names: Set<String>, entryBlock: () -> ActionRegistry.Entry)

Registers a new Entry using an initialization block for lazy creation.

Link copied to clipboard
fun removeEntry(name: String)

Unregisters an action entry.

Link copied to clipboard
fun updateEntry(name: String, predicate: ActionPredicate?): Boolean

Updates the predicate for a registered action entry.

fun updateEntry(name: String, action: Action, situation: Action.Situation? = null): Boolean

Updates the default action or a situation-specific action override for a registered entry.