|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvitro.grid.Location
public class Location
A Location represents a position on a Grid.
Field Summary | |
---|---|
int |
x
The grid column of this Location. |
int |
y
The grid row of this Location. |
Constructor Summary | |
---|---|
Location(Grid g,
int x,
int y)
Construct a new Location. |
Method Summary | |
---|---|
Location |
add(int x,
int y)
Create a new Location relative to this one given X and Y offsets. |
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
passable(Actor a)
Check the passability of this Location respecting the passable() predicate of the parent Grid. |
String |
toString()
|
boolean |
valid()
Confirm this Location is within the bounds of its Grid. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int x
public final int y
Constructor Detail |
---|
public Location(Grid g, int x, int y)
g
- the target Grid.x
- the grid column of this Location.y
- the grid row of this Location.Method Detail |
---|
public boolean valid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public Location add(int x, int y)
x
- the x-offset of the new Location.y
- the y-offset of the new Location.
public boolean passable(Actor a)
a
- the Actor to check.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |