Controller

interface Controller<M, E>

Defines a controller that can be used to start and stop MobiusLoops.

If a loop is stopped and then started again, the new loop will continue from where the last one left off.

Properties

Link copied to clipboard
abstract val isRunning: Boolean

Indicates whether this controller is running.

Link copied to clipboard
abstract val model: M

Get the current model of the loop that this controller is running, or the most recent model if it's not running.

Functions

Link copied to clipboard
abstract fun connect(view: Connectable<M, E>)

Connect a view to this controller.

Link copied to clipboard
abstract fun disconnect()

Disconnect UI from this controller.

Link copied to clipboard
abstract fun replaceModel(model: M)

Replace which model the controller should start from.

Link copied to clipboard
abstract fun start()

Start a MobiusLoop from the current model.

Link copied to clipboard
abstract fun stop()

Stop the currently running MobiusLoop.