All pastes #204307 Raw Edit

Unnamed

public java v1 · immutable
#204307 ·published 2006-10-15 20:55 UTC
rendered paste body
package rogueModel;import java.util.ArrayList; import rogueView.*;import rogueView.DungeonView.Direction; public class Room {        private int wig;        private int length;        private  Room[] neighbours = new Room[4];         public Room(){                wig = 3;                length = 3;                neighbours[0]=null;                neighbours[1]=null;                neighbours[2]=null;                neighbours[3]=null;        }        public Room(int w, int l,Room North,Room East,Room South,Room West){            wig=w;            length=l;            setNeighbourDirections(North,East,South,West);        }        public Room(int w, int l){                                wig=w;                length=l;                neighbours[0]=null;                neighbours[1]=null;                neighbours[2]=null;                neighbours[3]=null;        }        public void addHallway(Hallway h,DungeonView.Direction d)        {                        }        public void setNeighbourDirections(Room North,Room East,Room South,Room West){            neighbours[0] = North;            neighbours[1] = East;            neighbours[2] = South;            neighbours[3] = West;        }        public int getLength(){                                return length;        }        public int getWidth(){                 return wig;        }        public boolean  hasNeighbour(){                                int i =0;                while(i < 4){                                                if(neighbours[i] != null){                                                                return true;                        }                        i++;                }                                return false;        }        public  boolean hasNeighbour(Room r){                int i =0;                System.out.println("Testing\n");                while(i < 4){                           System.out.println(neighbours[i]);                        if(neighbours[i].equals(r)){                                return true;                        }                        i++;                }                return false;        }        public Room[] getNeighbourDirections(){                 return neighbours;        }}