type Brain() =
let mutable logicChobit = Chobits()
let mutable hardwareChobit = Chobits()
let mutable ear = Chobits()
let mutable skin = Chobits()
let mutable eye = Chobits()
let mutable emotion = ""
let mutable logicChobitOutput = ""
do
let kokoro = logicChobit.GetKokoro()
let chobitsInstances = [hardwareChobit; ear; skin; eye]
for chobit in chobitsInstances do
chobit.SetKokoro(kokoro)
// Getter for emotion
member this.GetEmotion() = emotion
// Getter for last output
member this.GetLogicChobitOutput() = logicChobitOutput
// Processing inputs (thinking cycle)
member this.DoIt(earInput: string, skinInput: string, eyeInput: string) =
logicChobitOutput <- logicChobit.Think(earInput, skinInput, eyeInput)
emotion <- logicChobit.GetSoulEmotion()
hardwareChobit.Think(logicChobitOutput, skinInput, eyeInput)
// Handling direct and sensory inputs
member this.Think(keyIn: string) =
if keyIn <> "" then
this.DoIt(keyIn, "", "")
else
this.DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""))
member this.Think() =
this.DoIt(ear.Think("", "", ""), skin.Think("", "", ""), eye.Think("", "", ""))
// Skill management
member this.AddLogicalSkill(skill: Skill) = logicChobit.AddSkill(skill)
member this.AddHardwareSkill(skill: Skill) = hardwareChobit.AddSkill(skill)
member this.AddEarSkill(skill: Skill) = ear.AddSkill(skill)
member this.AddSkinSkill(skill: Skill) = skin.AddSkill(skill)
member this.AddEyeSkill(skill: Skill) = eye.AddSkill(skill)