现在这行不通,因为差事为空。因此,每次都只是返回false。杂事总是从空开始。那么有没有办法做到这一点,以便每当addChore()方法尝试添加难度=困难的杂事后,它都会被忽略或擦除?
protected Chore choreList[] = new Chore[65];
protected int numChores = 0;
public boolean addChore(Chore chore) {
if(chore.getDifficulty() != Difficulty.HARD) {
choreList[numChores++] = chore;
return true;
}
else {
return false;
}
}