|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.uni_paderborn.robots.robot.group10.Map.Coordinate
Stores x and y coordinates and area information (when robot uses a wormhole).
It is also capable of using modulo values for the coordinates in order to support cyclic arenas.
The modulos are read from Map.getHorizontalCycleSize() and Map.getVerticalCycleSize().
| Field Summary | |
protected int |
area
The coordinate "name space". |
protected int |
x
The horizontal part of the coordinate |
protected int |
y
The vertical part of the coordinate |
| Constructor Summary | |
Map.Coordinate(int x,
int y,
int area)
Creates a Coordinate object using the given values. |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
Compares two coordinates. |
int |
getArea()
Read access method for the field area. |
Map.Coordinate |
getCoordinateByDirection(int direction)
Calculates the coordinate of the position neighbored by the position represented by this object. |
int |
getX()
Read access method for the field x. |
int |
getY()
Read access method for the field y. |
int |
hashCode()
More or less efficient hash calculation for this datatype |
void |
moduloChanged()
Should be called when the values Map.horizontalCycleSize or Map.verticalCycleSize have changed |
protected int |
posMod(int a,
int b)
Returns a modulo b. |
java.lang.String |
toString()
Returns a string representation of the coordinate. |
Map.Coordinate |
transform(Map.Coordinate c)
Adds two coordinates. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected int x
protected int y
protected int area
| Constructor Detail |
public Map.Coordinate(int x,
int y,
int area)
x - the horizontal part of the coordiantey - the vertical part of the coordinatearea - the coordinate "name space"| Method Detail |
public int getX()
public int getY()
public int getArea()
protected int posMod(int a,
int b)
a - the dividend for the modulo operationb - the divisor for the modulo operationpublic void moduloChanged()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - Object to be comparedpublic int hashCode()
hashCode in class java.lang.Objectpublic Map.Coordinate getCoordinateByDirection(int direction)
direction - the direction which to calculate the coordinate forpublic Map.Coordinate transform(Map.Coordinate c)
c - the coordinate to addpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||