Example #1
0
 public void walkedWithDog(boolean gettingDirty) {
   if ((getTime() - DogService.INSTANCE.getTimeLastWalked()) > THIRTYMINUTES) {
     DogService.INSTANCE.updateSatisfaction(10, 85);
     //            setView(DogMood.HAPPY);
   } else {
     DogService.INSTANCE.updateSatisfaction(-5, 60);
     //            setView(DogMood.SAD);
   }
   if (Math.random() < 0.75 && gettingDirty) {
     setDirty(true);
     //            setView(DogMood.DIRTY);
   }
   DogService.INSTANCE.setWantsToWalk(false);
 }
Example #2
0
 public void playedWithDog(boolean gettingDirty) {
   if ((getTime() - getTimeLastEaten()) > THIRTYMINUTES) {
     DogService.INSTANCE.updateSatisfaction(15);
   } else {
     DogService.INSTANCE.updateSatisfaction(-5, 60);
     Toast.makeText(
             view.getContext(),
             "Pas op! Wacht met spelen tot 30 minuten nadat je hond gegeten heeft!",
             Toast.LENGTH_LONG)
         .show();
   }
   if (Math.random() <= 0.75 && gettingDirty) {
     setDirty(true);
     //            setView(DogMood.DIRTY);
   }
   //        setView(DogMood.HAPPY);
   DogService.INSTANCE.setWantsToPlay(false);
   setTimeLastPlayed(new Date(getTime()));
 }
Example #3
0
 public void randomBark() {
   if (Math.random() >= 0.9975 && !DogService.INSTANCE.getBarking()) {
     DogService.INSTANCE.setBarking(true);
   }
 }
Example #4
0
 public long getTime() {
   return DogService.INSTANCE.getTime();
 }
Example #5
0
 public void setDirty(boolean dirty) {
   DogService.INSTANCE.setDirty(dirty);
 }
Example #6
0
 public boolean getDirty() {
   return DogService.INSTANCE.getDirty();
 }
Example #7
0
 public void setTimeLastPlayed(Date date) {
   DogService.INSTANCE.setTimeLastPlayed(date);
 }
Example #8
0
 public void setTimeLastEaten(Date date) {
   DogService.INSTANCE.setTimeLastEaten(date);
 }
Example #9
0
 public long getTimeLastEaten() {
   return DogService.INSTANCE.getTimeLastEaten();
 }
Example #10
0
 // Getters & Setters
 public long getTimeLastPlayed() {
   return DogService.INSTANCE.getTimeLastPlayed();
 }
Example #11
0
 public void hasEaten() {
   DogService.INSTANCE.setHungry(false);
   //        setView(DogMood.HAPPY);
   setTimeLastEaten(new Date(getTime()));
 }
Example #12
0
 public void cleanedDog() {
   DogService.INSTANCE.updateSatisfaction(10);
   DogService.INSTANCE.setDirty(false);
   setDirty(false);
 }