explorer
Class SpaceGrid

java.lang.Object
  extended by explorer.SpaceGrid

public class SpaceGrid
extends java.lang.Object

Implements a 2D virtual space (grid)

Author:
andreamonaldini

Constructor Summary
SpaceGrid(int dimension, int[][] cells)
          Creates a 2D virtual space - a square grid of X-Y cells (for both the axes the numeration start in the bottom-left corner)
 
Method Summary
 int getDimension()
          Returns the dimension of the grid
 int wallNumber()
          Returns the number of wall-cell in the grid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceGrid

public SpaceGrid(int dimension,
                 int[][] cells)
Creates a 2D virtual space - a square grid of X-Y cells (for both the axes the numeration start in the bottom-left corner)

Parameters:
dimension - The heigh (x or y-size) of the grid.
cells - Cell Matrix: value in (ACCESSIBLE, FORBIDDEN, WALL)
Method Detail

getDimension

public int getDimension()
Returns the dimension of the grid

Returns:
Returns the dimension of the grid

wallNumber

public int wallNumber()
Returns the number of wall-cell in the grid

Returns:
Returns the number of wall-cell in the grid