Add isBaby and setBaby to ageable watcher

This commit is contained in:
Andrew 2013-11-12 16:35:22 +13:00
parent 40c41fe1d0
commit f5c48eb264

View File

@ -9,12 +9,20 @@ public class AgeableWatcher extends LivingWatcher {
}
public boolean isAdult() {
return !isBaby();
}
public boolean isBaby() {
return (Integer) getValue(12, 0) >= 0;
}
public void setAdult(boolean isAdult) {
setValue(12, isAdult ? 0 : -24000);
public void setBaby(boolean isBaby) {
setValue(12, isBaby ? 0 : -24000);
sendData(12);
}
public void setAdult(boolean isAdult) {
setBaby(!isAdult);
}
}