public Room getActRoomTypeExitsNext() { Room nextRoom = null; Direction exit = getExit(); if (exit != null) { if (exit == Direction.LEFT) { nextRoom = grid.getRoom(position.goLeft()); System.err.println("LEFT"); } else if (exit == Direction.RIGHT) { nextRoom = grid.getRoom(position.goRight()); System.err.println("RIGHT"); } else if (exit == Direction.DOWN) { nextRoom = grid.getRoom(position.goDown()); System.err.println("DOWN"); } } if (nextRoom != null && nextRoom.isGateWay()) { nextRoom.actEntrance = getExit().opposite(); nextRoom.prev = this; next = nextRoom; } else { nextRoom = null; } return nextRoom; }