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)
}
}