Class GameMap

java.lang.Object
  |
  +--GameMap

public class GameMap
extends java.lang.Object

The map of the game field, here we do a little tradeoff time-memory in favor of time


Field Summary
private  int height
          height
static char HOME_BASE
          Home base tile
private  char[][] map
          the map
static char PLAIN
          Plain tile
static char WALL
          Wall tile
static char WATER
          Water tile
private  int width
          width
 
Constructor Summary
GameMap(int w, int h, char[][] field)
          Constructs a new game map
 
Method Summary
 char getAt(int x, int y)
          get whats inside the (x, y) position
 int height()
          get height
 int width()
          get width
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

PLAIN

public static final char PLAIN
Plain tile

WATER

public static final char WATER
Water tile

WALL

public static final char WALL
Wall tile

HOME_BASE

public static final char HOME_BASE
Home base tile

map

private char[][] map
the map

width

private int width
width

height

private int height
height
Constructor Detail

GameMap

public GameMap(int w,
               int h,
               char[][] field)
Constructs a new game map
Parameters:
w - width of the map
h - height of the map
field - the drawing of the map
Method Detail

getAt

public char getAt(int x,
                  int y)
get whats inside the (x, y) position

width

public int width()
get width

height

public int height()
get height