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