|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.Map.Position
public static final class Map.Position
Represents a position on the Map.
| Field Summary | |
|---|---|
int |
x
|
int |
y
|
| Constructor Summary | |
|---|---|
Map.Position(int posX,
int posY)
Creates a new object with the given position. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object other)
Compares the other Position based on the coordinates. |
Map.Position |
getAdjacent(Map.Direction direction)
Gets the position adjacent to a given position, in a given direction. |
int |
getDistance(Map.Position position)
Gets the distance in tiles between two map positions. |
int |
getX()
Returns the x-coordinate of this Position. |
int |
getY()
Returns the y-coordinate of this Position. |
int |
hashCode()
Returns a hash code value. |
java.lang.String |
toString()
Returns a string representation of the object. |
| 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 Map.Position(int posX,
int posY)
posX - The x-coordinate for this position.posY - The y-coordinate for this position.| Method Detail |
|---|
public int getX()
public int getY()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the reference object with which to compare.
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic Map.Position getAdjacent(Map.Direction direction)
direction - The direction (N, NE, E, etc.)
public int getDistance(Map.Position position)
position - The second position.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||