Commits

Shlomi Fish committed 89c8fbd

Convert _get_possible_letter_indexes to ::Coord.

Comments (0)

Files changed (1)

abc-path/Games-ABC_Path-Solver/lib/Games/ABC_Path/Solver/Board.pm

 
 sub _get_possible_letter_indexes
 {
-    my ($self, $x, $y) = @_;
+    my ($self, $xy) = @_;
 
     return 
     [
-        grep { $self->_get_verdict($_, Games::ABC_Path::Solver::Coord->new({x => $x, y => $y})) != $ABCP_VERDICT_NO }
+        grep { $self->_get_verdict($_, $xy) != $ABCP_VERDICT_NO }
         $self->_l_indexes()
     ];
 }
 {
     my ($self, $x, $y) = @_;
 
-    return [@letters[@{$self->_get_possible_letter_indexes($x,$y)}]];
+    return [@letters[@{$self->_get_possible_letter_indexes(Games::ABC_Path::Solver::Coord->new({x => $x, y => $y}))}]];
 }
 
 sub _get_possible_letters_string
     $self->_xy_loop(sub {
         my ($xy) = @_;
 
-        my $letters_aref = $self->_get_possible_letter_indexes($xy->x, $xy->y);
+        my $letters_aref = $self->_get_possible_letter_indexes($xy);
 
         if (! @$letters_aref)
         {
     $self->_xy_loop(sub {
         my ($xy) = @_;
 
-        my $letters_aref = $self->_get_possible_letter_indexes($xy->x, $xy->y);
+        my $letters_aref = $self->_get_possible_letter_indexes($xy);
 
         if (! @$letters_aref)
         {