Commits

Anonymous committed f205f60

Moved _get_text to the ::Move super-class.

  • Participants
  • Parent commits cc1042f

Comments (0)

Files changed (7)

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

 
 sub _get_text
 {
-    my ($self) = @_;
-    
-    return $self->{_text};
+    my $self = shift;
+
+    my $text = $self->_format;
+
+    $text =~ s/%\((\w+)\)\{(\w+)\}/
+        $self->_expand_format($1,$2)
+        /ge;
+
+    return $text;
 }
 
 sub _depth {

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

 
 =cut
 
-sub _get_text {
-    my $self = shift;
-
-    my $text = $self->_format;
-
-    $text =~ s/%\((\w+)\)\{(\w+)\}/
-        $self->_expand_format($1,$2)
-        /ge;
-
-    return $text;
-}
-
 sub _format {
     return "For %(letter){letter} only %(coords){coords} is possible.";
 }

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

 
 =cut
 
-sub _get_text {
-    my $self = shift;
-
-    my $text = $self->_format;
-
-    $text =~ s/%\((\w+)\)\{(\w+)\}/
-        $self->_expand_format($1,$2)
-        /ge;
-
-    return $text;
-}
-
 sub _format {
     return "The only letter that can be at %(coords){coords} is %(letter){letter}. Invalidating it for all other cells.";
 }

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

 
 =cut
 
-sub _get_text {
-    my $self = shift;
-
-    my $text = $self->_format;
-
-    $text =~ s/%\((\w+)\)\{(\w+)\}/
-        $self->_expand_format($1,$2)
-        /ge;
-
-    return $text;
-}
-
 sub _format {
     return "%(target){letter} cannot be at %(coords){coords} due to lack of vicinity from %(source){letter}.";
 }

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

 This is a move that a branch resulted in an error.
 
 =cut
-
-sub _get_text {
-    my $self = shift;
-
-    my $text = $self->_format;
-
-    $text =~ s/%\((\w+)\)\{(\w+)\}/
-        $self->_expand_format($1,$2)
-        /ge;
-
-    return $text;
-}
-
 sub _format {
     return "Trying %(letter){letter} for %(coords){coords} returns a success.";
 }

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

 
 =cut
 
-sub _get_text {
-    my $self = shift;
-
-    my $text = $self->_format;
-
-    $text =~ s/%\((\w+)\)\{(\w+)\}/
-        $self->_expand_format($1,$2)
-        /ge;
-
-    return $text;
-}
-
 sub _format {
     return "Trying %(letter){letter} for %(coords){coords} results in an error.";
 }

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

 
 =cut
 
-sub _get_text {
-    my $self = shift;
-
-    my $text = $self->_format;
-
-    $text =~ s/%\((\w+)\)\{(\w+)\}/
-        $self->_expand_format($1,$2)
-        /ge;
-
-    return $text;
-}
-
 sub _format {
     return "We have non-conclusive cells. Trying %(letter){letter} for %(coords){coords}";
 }