|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gecco.client.Map
This class represents the map of a game. The map should be given an Image and a map size. The map has a coordinate system of its own, where the upper left corner is (0,0), and every pixel is an automaton. The coordinates are then given as integer numbers.
Every point of the map can be set as either visible or invisible. When a point is invisible it is painted darker. To make a point invisible, call hidePoint(). To make a point visible, or to change the state of som point (automaton), call method updatePoint.
Constructor Summary | |
Map()
Initilizes a new map. |
Method Summary | |
void |
clear()
Clears the map. |
Position |
getCenter()
Return the center of the map, in map coordinates. |
Image |
getImage()
Gets the image of automaton colors. |
Dimension |
getSize()
Return the size of the map, in automatons. |
void |
hidePoint(int x,
int y)
Makes the given point invisibile by making it darker. |
void |
loadMap(BufferedImage map)
Loads the given image as map. |
void |
setSize(Dimension size)
|
void |
updatePoint(int x,
int y,
int color)
Updates the given point of the map to the new color. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Map()
size
- The size of the map, in automatons.Method Detail |
public Dimension getSize()
public Position getCenter()
public Image getImage()
public void clear()
public void loadMap(BufferedImage map)
map
- Description of Parameterpublic void hidePoint(int x, int y)
x
- Description of Parametery
- Description of Parameterpublic void updatePoint(int x, int y, int color)
x
- The x coordinate of the point.y
- The y coordinate of the point.color
- The color of the point, given as an int as described in
java.awt.Color.public void setSize(Dimension size)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |