Context

interface Context

Implemented by instances that can hold longer lasting state than a blackboard. Offers the same ability to add an object or bind it to a key.

Inheritors

Properties

Link copied to clipboard
abstract val id: String

May be null for a new context not yet saved.

Link copied to clipboard
abstract val objects: List<Any>

Entries in the order they were added. The default instance of any type is the last one Objects are immutable and may not be removed.

Functions

Link copied to clipboard
abstract fun addObject(value: Any)
Link copied to clipboard
abstract fun bind(key: String, value: Any)
Link copied to clipboard
open fun <T> last(clazz: Class<T>): T?

Get the last object of the given type, or null if none.

Link copied to clipboard
abstract fun populate(blackboard: Blackboard)

Populate the given blackboard from the context.