Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void generateMap(){
- for(int i=0; i<rooms.size(); i++){
- if(i==0) addToMap(rooms.get(i), 0, 1);
- else addToMap(rooms.get(i));
- }
- }
- public void showMap(){
- for(int i=0; i<MAX_HEIGHT; i++){
- boolean firstRoomInRow = true;
- for(int j=0; j<MAX_WIDTH; j++){
- if(world[i][j]!=0 && rooms.get(world[i][j]-1).getNorth()==null
- & i>=1 && world[i-1][j]!=0) {System.out.print(((firstRoomInRow)?"+":"=")+"===+");firstRoomInRow = false;}
- else if(world[i][j]!=0) {System.out.print(((firstRoomInRow)?"+":"-") + "---+"); firstRoomInRow = false;}
- else System.out.print(" ");
- }
- System.out.println();
- firstRoomInRow = true;
- for(int j=0; j<MAX_WIDTH; j++){
- if(world[i][j]==0) System.out.print(" ");
- else { System.out.print(((firstRoomInRow)?"| ":" ") + rooms.get(world[i][j]-1).getName().charAt(rooms.get(world[i][j]-1).getName().length()-1) + " |");firstRoomInRow = false;}
- }
- System.out.println();
- firstRoomInRow = true;
- if(i+1==MAX_HEIGHT)
- for(int j=0; j<MAX_WIDTH; j++){
- if(world[i][j]!=0 && rooms.get(world[i][j]-1).getSouth()==null
- & i+1<MAX_HEIGHT && world[i+1][j]!=0) {System.out.print(((firstRoomInRow)?"+":"=")+ "===+"); firstRoomInRow = false;}
- else if(world[i][j]!=0) {System.out.print(((firstRoomInRow)?"+":"-") + "---+"); firstRoomInRow = false;}
- else System.out.print(" ");
- }
- }
- System.out.println();
- }
Advertisement
Add Comment
Please, Sign In to add comment