Commits

Shlomi Fish committed 85ebf30

Convert ::Move to use ::Coord .

  • Participants
  • Parent commits fc66292

Comments (0)

Files changed (3)

abc-path/Games-ABC_Path-Solver/Changes

 Revision history for Games-ABC_Path-Solver
 
+        - Extract the class lib/Games/ABC_Path/Solver/Coord.pm .
+            - Backwards incompatible change: get_var for 'coords'/etc.
+            in Games::ABC_Path::Solver::Move now returns them instead of
+            an [x,y] array ref.
+
 0.2.0   Sat Jul 23 21:22:17 IDT 2011
         - Create lib/Games/ABC_Path/Solver/Constants.pm based on the one 
         from Games::ABC_Path::Generator.

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

                             vars =>
                             {
                                 letter => $letter,
-                                coords => [$xy->x, $xy->y],
+                                coords => $xy,
                             },
                         }
                     )
                                 vars =>
                                 {
                                     target => $neighbour_letter,
-                                    coords => [$xy->x, $xy->y],
+                                    coords => $xy,
                                     source => $letter,
                                 },
                             }
                         {
                             vars =>
                             {
-                                coords => [$xy->x, $xy->y],
+                                coords => $xy,
                                 letter => $letter,
                             },
                         },
             $self->_add_move(
                 Games::ABC_Path::Solver::Move::TryingLetterForCell->new(
                     {
-                        vars => { letter => $letter, coords => [$xy->x, $xy->y], },
+                        vars => { letter => $letter, coords => $xy, },
                     }
                 ),
             );
                         vars =>
                         {
                             letter => $letter,
-                            coords => [$xy->x, $xy->y],
+                            coords => $xy,
                         },
                     }
                     )
                 $self->_add_move(
                     Games::ABC_Path::Solver::Move::ResultsInASuccess->new(
                         {
-                            vars => { letter => $letter, coords => [$xy->x, $xy->y],},
+                            vars => { letter => $letter, coords => $xy,},
                         }
                     )
                 );

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

     }
     elsif ($type eq "coords")
     {
-        return sprintf("(%d,%d)", $value->[0]+1, $value->[1]+1);
+        return sprintf("(%d,%d)", $value->x()+1, $value->y()+1);
     }
     else
     {