|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ou.pacman.util.Location2D
public class Location2D
Class used to represent a 2 dimensional location on the game board.
Constructor Summary | |
---|---|
Location2D(int x,
int y)
|
|
Location2D(Location2D other)
|
Method Summary | |
---|---|
Direction[] |
directionsToOther(Location2D other)
Return the directions from one location to another. |
Direction |
directionToOther(Location2D other)
Determines the direction needed to go towards another location. |
double |
distanceFrom(Location2D other)
Returns the distance from one location to another. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
toString()
|
int |
xCoordinate()
|
int |
yCoordinate()
|
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Location2D(int x, int y)
public Location2D(Location2D other)
Method Detail |
---|
public Direction directionToOther(Location2D other)
other
- - The location to find the direction towards
public Direction[] directionsToOther(Location2D other)
other
- - The other location to go to
public double distanceFrom(Location2D other)
other
- - The location to get the distance from
public int xCoordinate()
public int yCoordinate()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |