src/main/java/cursor/rybak/game/MazeSetUp.java
/**
     * Generate location abstraction
     *
     * @param maze maze class
     * @return maze map
     */
Generate location abstraction
@param maze maze class
@return maze map
Generate location abstraction @param maze maze class @return maze map
private static Map<String, Location> generateGameLocations(AbstractMaze maze) {
        Map<String, Location> mazeMap = MazeMap.getMazeMap(maze.getMaze());
        Map<String, List<Location>> LinesA = MazeMap.getLinesA(maze.getMaze(), mazeMap);
        Map<String, List<Location>> LinesB = MazeMap.getLinesB(maze.getMaze(), mazeMap);
        mazeMap.forEach((keyLocation, location) -> {
            LinesA.forEach((keyLine, lineA) -> {
                if (keyLine.contains(";" + keyLocation + ";")) {
                    location.setLineA(listOfNeighbors(lineA, location));
                }
            });
            LinesB.forEach((keyLine, lineB) -> {
                if (keyLine.contains(";" + keyLocation + ";")) {
                    location.setLineB(listOfNeighbors(lineB, location));
                }
            });
            location.setDescription(getLocationDescription());
        });
        return mazeMap;
    }
private static Map < String , Location > generateGameLocations ( AbstractMaze maze ) { Map < String , Location > mazeMap = MazeMap . getMazeMap ( maze . getMaze ( ) ) ; Map < String , List < Location > > LinesA = MazeMap . getLinesA ( maze . getMaze ( ) , mazeMap ) ; Map < String , List < Location > > LinesB = MazeMap . getLinesB ( maze . getMaze ( ) , mazeMap ) ; mazeMap . forEach ( ( keyLocation , location ) -> { LinesA . forEach ( ( keyLine , lineA ) -> { if ( keyLine . contains ( ";" + keyLocation + ";" ) ) { location . setLineA ( listOfNeighbors ( lineA , location ) ) ; } } ) ; LinesB . forEach ( ( keyLine , lineB ) -> { if ( keyLine . contains ( ";" + keyLocation + ";" ) ) { location . setLineB ( listOfNeighbors ( lineB , location ) ) ; } } ) ; location . setDescription ( getLocationDescription ( ) ) ; } ) ; return mazeMap ; }
Generate location abstraction
 @param maze maze class
 @return maze map
Generate location abstraction @param maze maze class @return maze map
// prepared map with Locations // prepared map with lines (vertical & horizontal)