Commits

Anonymous committed eb1e6da

Convert more to ::Coords.

This time the Island BrFS scan.

Comments (0)

Files changed (1)

nurikabe-solver/Games-Nurikabe-Solver/lib/Games/Nurikabe/Solver/Island.pm

 {
     my $island = shift;
 
-    $island->_queue([map { [0,$_->_to_pair()] } @{$island->known_cells()}]);
+    $island->_queue([map { [0,$_] } @{$island->known_cells()}]);
 
     return;
 }
 {
     my ($island, $board, $item) = @_;
 
-    my ($dist, $c) = @$item;
+    my ($dist, $coords) = @$item;
 
     if ($dist == $island->_dist_limit())
     {
         return;
     }
 
-    my $coords = Games::Nurikabe::Solver::Coords->new(
-        {y => $c->[0], x => $c->[1], }
-    );
-    
     $board->_vicinity_loop($coords,
         sub {
             my $to_check = shift;
             $island->_enqueue($cell->set_island_reachable(
                 $island->idx(),
                 $dist+1,
-                $to_check->_to_pair(),
+                $to_check,
             ));
         },
     );