coding lab online!
deploying check point!!
deploying check point!!
Java:
public class Brain {
public Chobits logicChobit = new Chobits();
private String emotion = "";
private String bodyInfo = "";
private String logicChobitOutput = "";
public Chobits hardwareChobit = new Chobits();
public Chobits ear = new Chobits(); // 120425 upgrade
public Chobits skin = new Chobits();
public Chobits eye = new Chobits();
public String getEmotion() {
return emotion;
}
public String getBodyInfo() {
return bodyInfo;
}
public String getLogicChobitOutput() {
return logicChobitOutput;
}
public Brain() {
Brain.imprintSoul(this.logicChobit.getKokoro(), this.hardwareChobit, this.ear, this.skin, this.eye);
}
public static void imprintSoul(Kokoro kokoro, Chobits... args) {
for (Chobits arg : args) {
arg.setKokoro(kokoro);
}
}
public void doIt(String ear, String skin, String eye) {
if (!bodyInfo.isEmpty()){
logicChobitOutput = logicChobit.think(ear,bodyInfo,eye);
}
else{
logicChobitOutput = logicChobit.think(ear,skin,eye);
}
emotion = logicChobit.getSoulEmotion();
// case: hardware skill wishes to pass info to logical chobit
bodyInfo = hardwareChobit.think(logicChobitOutput,skin,eye);
}
public void addLogicalSkill(Skill skill){logicChobit.addSkill(skill);}
public void addHardwareSkill(Skill skill){hardwareChobit.addSkill(skill);}
// 120425 upgrade
public void addEarSkill(Skill skill) {
this.ear.addSkill(skill);
}
public void addSkinSkill(Skill skill) {
this.skin.addSkill(skill);
}
public void addEyeSkill(Skill skill) {
this.eye.addSkill(skill);
}
public void think(String ear) {
if (!ear.isEmpty()) {
// handles typed inputs
this.doIt(ear, "", "");
} else {
// accounts for sensory inputs
this.doIt(this.ear.think("", "", ""), this.skin.think("", "", ""), this.eye.think("", "", ""));
}
}
public void think() {
// accounts for sensory inputs
this.doIt(this.ear.think("", "", ""), this.skin.think("", "", ""), this.eye.think("", "", ""));
}
}