Commits

Shlomi Fish committed 349787e

Extract a method.

  • Participants
  • Parent commits a050902

Comments (0)

Files changed (2)

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

 
             $self->_set_verdict($letter, $xy,
                 # TODO : extract a method for coords equality
-                ((($l_xy->x == $xy->x) && ($l_xy->y == $xy->y))
+                ($l_xy->_equal($xy)
                     ? $ABCP_VERDICT_YES
                     : $ABCP_VERDICT_NO
                 )

File abc-path/Games-ABC_Path-Solver/lib/Games/ABC_Path/Solver/Coord.pm

     return;
 }
 
+sub _equal
+{
+    my ($self,$other_xy) = @_;
+
+    return (($self->x == $other_xy->x) && ($self->y == $other_xy->y));
+}
+
 =head1 AUTHOR
 
 Shlomi Fish, L<http://www.shlomifish.org/>