| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class represents a location in the game. Each location is composed of
three parts. The first is a reference to the Screen it is a location in.
The second is the course x,y coordinate specifying the block it is in. The
third is a fine grained x,y giving a more accurate point in that block.
It should be noted that this class is immutable. Once you create an instance
of it, the values in it will not be changed. The partialMove method returns
a new Location object that is offset from the current one by the specified
number of "partial coordinate" units.
Constructor Summary | |
Location(Screen s, int x, int y) Constructor that sets the main location coordinates. | |
Location(Screen s, int x, int y, int px, int py) Constructor that sets all the location coordinates. | |
Location(Location loc) This copy constructor isn't really needed because this is an immutable class. |
Method Summary | |
boolean | equals(Object o) This method overrides the same method from object. |
int | getLocX() Returns the x block location. |
int | getLocY() Returns the y block location. |
static int | getPartialsInWhole() |
int | getPartialX() Returns the x partial block location. |
int | getPartialY() Returns the y partial block location. |
Screen | getScreen() Returns the Screen object that this location is in. |
Location | partialMove(int dx, int dy) Returns a Location object that has been offset from this one by the specified partial block distance. |
static void | setPartialsInWhole(int num) |
Constructor Detail |
public Location(Screen s, int x, int y)
public Location(Screen s, int x, int y, int px, int py)
public Location(Location loc)
Method Detail |
public boolean equals(Object o)
public int getLocX()
public int getLocY()
public static int getPartialsInWhole()
public int getPartialX()
public int getPartialY()
public Screen getScreen()
public Location partialMove(int dx, int dy)
public static void setPartialsInWhole(int num)
Association Links |
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |