Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gecco.client
Class Map

    java.lang.Object
      gecco.client.Map

public class Map
extends Object

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.

Author:
  Andreas Enblom, Karl Hasselström

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(Point p)` 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(Point p, 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

### Map

    public Map()

  Initilizes a new map.

Method Detail

### getSize

    public Dimension getSize()

  Return the size of the map, in automatons.

  Returns:
    The map size in automatons.

### getCenter

    public Position getCenter()

  Return the center of the map, in map coordinates.

  Returns:
    The center of the map.

### getImage

    public Image getImage()

  Gets the image of automaton colors.

  Returns:
    The automaton image.

### clear

    public void clear()

  Clears the map.

### loadMap

    public void loadMap(BufferedImage map)

  Loads the given image as map. The map is set as invisible.

  Parameters:
    `map` - Description of Parameter

### hidePoint

    public void hidePoint(Point p)

  Makes the given point invisibile by making it darker. If the point is already set as invisible, nothing is done.

  Parameters:
    `p` - Description of Parameter

### updatePoint

    public void updatePoint(Point p,
                            int color)

  Updates the given point of the map to the new color. This marks the point as visible.

  Parameters:
    `p` - The point of the map to update, remember that the map has (0,0) as its upper left corner.
    `color` - The color of the point, given as an int as described in java.awt.Color.

### setSize

    public void setSize(Dimension size)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD