Beispiel #1
0
 public static function getAdjacentsByMaxDistance($x, $y, $distance)
 {
     global $origins;
     if ($distance > 0) {
         $adjacents = Sector::getAdjacents($x, $y);
         $origins = array_merge($origins, $adjacents);
         $origins = array_unique($origins);
         if ($distance > 1) {
             foreach ($adjacents as $adjacent) {
                 $adjacent = explode(",", $adjacent);
                 $x = $adjacent[0];
                 $y = $adjacent[1];
                 Sector::getAdjacentsByMaxDistance($x, $y, $distance - 1);
             }
         }
     }
 }