👨‍💻 dev Java->Kotlin port

development

fukurou

the supreme coder
ADMIN
Code:
class Brain {
    var logicChobit: Chobits
    var hardwareChobit: Chobits
    var emotion = ""
        private set
    var bodyInfo = ""
        private set
    var logicChobitOutput = ""
        private set

    init {
        logicChobit = Chobits()
        hardwareChobit = Chobits()
        hardwareChobit.kokoro = logicChobit.kokoro
    }

    fun doIt(ear: String, skin: String, eye: String) {
        logicChobitOutput = if (!bodyInfo.isEmpty()) {
            logicChobit.think(ear, bodyInfo, eye)
        } else {
            logicChobit.think(ear, skin, eye)
        }
        emotion = logicChobit.soulEmotion
        // case: hardware skill wishes to pass info to logical chobit
        bodyInfo = hardwareChobit.think(logicChobitOutput, skin, eye)
    }
}
 

fukurou

the supreme coder
ADMIN
Kotlin:
class DiSysOut : DiSkillV2() {
    override fun input(ear: String, skin: String, eye: String) {
        if (!ear.isEmpty() and !ear.contains("#")) {
            println(ear)
        }
    }
}
 
Top