All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ControllerStateCreated.kt Maven / Gradle / Ivy

package kt.mobius

class ControllerStateCreated(
    private val actions: ControllerActions,
    private val renderer: Connection,
    private var nextModelToStartFrom: M
) : ControllerStateBase() {

    override val stateName: String
        get() = "created"

    override fun onDisconnect() {
        renderer.dispose()
        actions.goToStateInit(nextModelToStartFrom)
    }

    override fun onStart() {
        actions.goToStateRunning(renderer, nextModelToStartFrom)
    }

    override fun onReplaceModel(model: M) {
        nextModelToStartFrom = model
    }

    override fun onGetModel(): M {
        return nextModelToStartFrom
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy