Exemplo n.º 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);
 }
Exemplo n.º 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()));
 }
Exemplo n.º 3
0
 public void randomBark() {
   if (Math.random() >= 0.9975 && !DogService.INSTANCE.getBarking()) {
     DogService.INSTANCE.setBarking(true);
   }
 }
Exemplo n.º 4
0
 public long getTime() {
   return DogService.INSTANCE.getTime();
 }
Exemplo n.º 5
0
 public void setDirty(boolean dirty) {
   DogService.INSTANCE.setDirty(dirty);
 }
Exemplo n.º 6
0
 public boolean getDirty() {
   return DogService.INSTANCE.getDirty();
 }
Exemplo n.º 7
0
 public void setTimeLastPlayed(Date date) {
   DogService.INSTANCE.setTimeLastPlayed(date);
 }
Exemplo n.º 8
0
 public void setTimeLastEaten(Date date) {
   DogService.INSTANCE.setTimeLastEaten(date);
 }
Exemplo n.º 9
0
 public long getTimeLastEaten() {
   return DogService.INSTANCE.getTimeLastEaten();
 }
Exemplo n.º 10
0
 // Getters & Setters
 public long getTimeLastPlayed() {
   return DogService.INSTANCE.getTimeLastPlayed();
 }
Exemplo n.º 11
0
 public void hasEaten() {
   DogService.INSTANCE.setHungry(false);
   //        setView(DogMood.HAPPY);
   setTimeLastEaten(new Date(getTime()));
 }
Exemplo n.º 12
0
 public void cleanedDog() {
   DogService.INSTANCE.updateSatisfaction(10);
   DogService.INSTANCE.setDirty(false);
   setDirty(false);
 }