StateMachineFacet

class StateMachineFacet<C : Context, P : Message<C>>(messageType: KClass<P>, initialState: Facet<C, out P>) : Facet<C, P>

Functions

compose
Link copied to clipboard
common
open fun compose(other: Facet<C, P>, commonAncestor: KClass<P>): Facet<C, P>
Composes this Facet with other which means that when receive is called its result will be passed to other's receive when the Response is Pass (until all options are exhausted, in this case Pass will be returned).
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
receive
Link copied to clipboard
common
open suspend override fun receive(message: P): Response
Receives the given message.
toString
Link copied to clipboard
common
open fun toString(): String
tryReceive
Link copied to clipboard
common
open suspend override fun tryReceive(message: Message<C>): Response
Tries to receive the given message by checking if it has an acceptable messageType.

Properties

currentState
Link copied to clipboard
common
var currentState: Facet<C, out P>
id
Link copied to clipboard
common
open override val id: UUID
The unique identifier of this System
mandatoryAttributes
Link copied to clipboard
common
open override val mandatoryAttributes: Set<KClass<out Attribute>>
The Set of Attributes that must be present in this System
messageType
Link copied to clipboard
common
open override val messageType: KClass<P>
The type of the Message this Facet accepts.

Sources

(source)
Link copied to clipboard