EventHolder

abstract class EventHolder<T : EventSchema>

Live, mutable counterpart of an EventSchema instance registered somewhere in a screen's tile tree — one holder per event, built by an EventHolderBuilder. Mirrors dev.catbit.mosaic.client.ui.sdui.foundation.tiles.holder.tile.TileHolder's shape, but note the key difference: an EventHolder is used only for lookup and patching by id (TriggerEvent, UpdateEvents) — it never runs anything itself. Execution always goes through the matching EventRunner directly, dispatched by EventManager, entirely independent of whether a holder exists for that event.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val id: String

Id of this event — how TriggerEvent/UpdateEvents and getEventHolder/getTileHolder address it by id.

Link copied to clipboard
abstract val trigger: EventTrigger

This event's own trigger condition — not itself mutated by update's JSON-patch merge in practice (an update targeting trigger would be unusual), but part of the schema get() returns.

Functions

Link copied to clipboard
fun get(): T

Returns this event's current T snapshot. Re-derives via getEventSchema and clears the dirty flag when isDirty is true; otherwise returns the cached event unchanged.

Link copied to clipboard
fun getEventHolder(eventId: String): EventHolder<*>?

Searches this holder's own subtree (this event, then depth-first through events and tiles) for the EventHolder whose id equals eventId — the lookup behind TriggerEvent/UpdateEvents, when it recurses past the point where TilesManager.getEventHolder handed off into a specific event's own nested structure.

Link copied to clipboard
fun getTileHolder(tileId: String): TileHolder<*>?

Searches this event's own tiles (then, recursively, its own events) for the TileHolder whose id equals tileId — the counterpart lookup to TileHolder.getTileHolder, letting a search cross from the tile side into an event's own nested tiles and back.

Link copied to clipboard
open fun isDirty(): Boolean

Whether this holder — or any descendant tile or event holder — has been markAsDirty'd since it was last read via get.

Link copied to clipboard

Marks this holder as needing its schema re-derived the next time get is called. Called after update applies a patch.

Link copied to clipboard
fun UpdateScope.update(updateData: Map<String, Any?>)

Applies updateData as a shallow JSON-patch merge onto this event's current event — the mechanism behind UpdateEvents, the event-level equivalent of dev.catbit.mosaic.client.ui.sdui.foundation.tiles.holder.tile.TileHolder.update. Unlike the tile version, there's no special-cased nested field (no style equivalent) — every top-level key in updateData simply overwrites the matching key on the encoded event object, and the merged JSON is decoded back into a fresh T via the framework's dev.catbit.mosaic.core.serialization.MosaicSerializer.