Example #1
0
 /**
  * Method che fa crescere tutti gli agnelli di 1 turno e se ne trova uno abbastanza grande lo fa
  * diventare pecora o montone
  */
 protected void growUpLambs() {
   // è protected per poterlo testare
   for (Sheep ele : game.getSheeps()) {
     // se è un lamb lo faccio crescere
     if (ele.isLamb()) {
       ele.growUpOneTurn();
       // se non è più lamb allora è cresciuto
       if (!ele.isLamb()) {
         String kind;
         if (ele.isRam()) {
           kind = TypeAnimal.RAM.toString();
         } else {
           kind = TypeAnimal.WHITE_SHEEP.toString();
         }
         connectionManager.refreshTransformAnimal(ele.getId(), kind);
       }
     }
   }
 }