|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.Grid
public class Grid
Constructor Summary | |
---|---|
Grid(int Xmax,
int Ymax)
Starts a new grid with specified dimensions, Xmax by Ymax |
Method Summary | |
---|---|
void |
add(Room obj,
int x,
int y)
Adds an object at the specified point |
int[] |
getCoord(Room p)
Returns the coordinates of point p in an array with index 0 = x and 1 = y |
Exit |
getExit(Room r,
java.lang.String d)
Returns the exit corresponding to the room and direction specified |
int[] |
getOffset(Room r1,
Room r2)
Returns the offset from r1 to r2 |
Room |
getStart()
Returns the start room |
boolean |
isOnGrid(Room r)
Checks to see if the room is on the grid |
void |
linkRooms(Room r1,
Room r2,
boolean passable,
boolean locked,
java.lang.String name,
java.lang.String desc)
'Links' two rooms using an exit |
Room |
objEast(Room p)
Returns the object(s) east of point p |
Room |
objNorth(Room p)
Returns the object(s) north of point p |
Room |
objSouth(Room p)
Returns the object(s) south of point p |
Room |
objWest(Room p)
Returns the object(s) west of point p |
Room |
roomAtOffset(Room p,
int xOffset,
int yOffset)
Returns the object(s) at an offset of point p |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Grid(int Xmax, int Ymax)
Xmax
- define the maximum x value on the gridYmax
- define the maximum y value on the gridMethod Detail |
---|
public Room getStart()
public void add(Room obj, int x, int y)
obj
- room to be added to the gridx
- x value of room on gridy
- y value of room on gridpublic Room objNorth(Room p)
p
- reference room
public Room objEast(Room p)
public Room objSouth(Room p)
public Room objWest(Room p)
public Room roomAtOffset(Room p, int xOffset, int yOffset)
public int[] getOffset(Room r1, Room r2)
public boolean isOnGrid(Room r)
public int[] getCoord(Room p)
public void linkRooms(Room r1, Room r2, boolean passable, boolean locked, java.lang.String name, java.lang.String desc)
public Exit getExit(Room r, java.lang.String d)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |