Ejemplo n.º 1
0
 /**
  * Sono state accorpate qui tutte le funzioni per una gestione più efficiente
  */
 public function moveAllFish()
 {
     $matrix = $this->worldMap->getMatrix();
     foreach ($matrix as $x => $rows) {
         foreach ($rows as $y => $fish) {
             $current = new Position($x, $y);
             // Gestisco il Movimento
             if ($fish instanceof MovableInterface) {
                 $current = $this->moveFish($fish, $current);
             }
             // Gestisco la vita
             if ($fish instanceof FishInterface) {
                 $this->aging($fish, $current);
             }
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * @return array mappa intera del mondo con le posizioni
  */
 public function getMap()
 {
     return $this->matrix->getMatrix();
 }