|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmap.MapPoint
public class MapPoint
A Map Point is a point on the Grid
that can be assigned a specific
Unit
, created for example by tapping the stylus on a specific
location on the Grid.
Coherent Map Points (see figure MAP Grid
) are stored in a vector
(= Path). The path is used for creating MapItemList
s in later step.
e.g.: Map Point 1 has the coordinates (x,y)
and is mapped
to Unit (0,3)
Note:
A Map Point is not a MapItem
!
MapItemList
,
Grid
,
Unit
Constructor Summary | |
---|---|
MapPoint(int x,
int y,
java.lang.Integer unitId)
Creates a Map Point with default color: white |
|
MapPoint(int x,
int y,
java.lang.Integer unitId,
int color)
Creates a Map Point with a given color |
Method Summary | |
---|---|
int |
getColor()
Returns the color of the Map Point |
java.lang.Integer |
getUnitId()
Returns the mapped Unit Id to the Map Point |
int |
getX()
Returns the x-axis value in pixels |
int |
getY()
Returns the y-axis value in pixels |
static boolean |
minDistance(int x1,
int y1,
int x2,
int y2,
int d)
Returns true , if the distance between points p1(x1,y1) and p2(x2,y2)
is bigger than the given distance d |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MapPoint(int x, int y, java.lang.Integer unitId, int color)
x
- x-axis Value (in Pixels)y
- y-axis Value (in Pixels)unitId
- The corresponding Unit Id of the Map Point on the Gridcolor
- The Color of the Map Pointpublic MapPoint(int x, int y, java.lang.Integer unitId)
x
- x-axis Value (in Pixels)y
- y-axis Value (in Pixels)unitId
- The corresponding Unit Id of the Map Point on the GridMethod Detail |
---|
public static boolean minDistance(int x1, int y1, int x2, int y2, int d)
true
, if the distance between points p1(x1,y1) and p2(x2,y2)
is bigger than the given distance d
x1
- the x value of point p1y1
- the y value of point p1x2
- the x value of point p2y2
- the y value of point p2d
- the minimal distance between the 2 given points
true
,
if the distance between points p1(x1,y1) and p2(x2,y2)
is bigger than the given distance dpublic int getX()
public int getY()
public java.lang.Integer getUnitId()
public int getColor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |