public String getReplacedMazeString ( List < Map < Point , Character > > replacements ) { String [ ] stringMaze = toStringArray ( ) ; for ( Map < Point , Character > replacement : replacements ) { for ( Point p : replacement . keySet ( ) ) { int row = p . y ; int column = p . x ; char c = stringMaze [ row ] . charAt ( column ) ; if ( c != Symbol . START . value ( ) && c != Symbol . GOAL . value ( ) ) { stringMaze [ row ] = replaceChar ( stringMaze [ row ] , column , replacement . get ( p ) ) ; } } } String output = "" ; for ( String line : stringMaze ) { output += String . format ( "%s%n" , line ) ; } return output ; }
Generates a string representation of this maze but replacing all the indicated points with the characters provided .