explorer
Class SpaceCell

java.lang.Object
  extended by explorer.SpaceCell

public class SpaceCell
extends java.lang.Object

This class implements a cell to be inserted in a SpaceGrid grid

Author:
andreamonaldini

Field Summary
static int ACCESSIBLE
          An accessible cell
static int FORBIDDEN
          A forbidden cell (not accessible to all explorators)
static int WALL
          A wall
 
Constructor Summary
SpaceCell(int cellType)
          Create a new cell
 
Method Summary
 int cellType()
          Check the cell type
 boolean isAccessible()
          Check if the cell is accessible.
 boolean isForbidden()
          Check if the cell is forbidden
 boolean isWall()
          Check if the cell is a wall
 void setCellType(int cellType)
          Sets the cell type (SpaceCell.ACCESSIBLE - SpaceCell.FORBIDDEN - SpaceCell.WALL)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCESSIBLE

public static final int ACCESSIBLE
An accessible cell

See Also:
Constant Field Values

FORBIDDEN

public static final int FORBIDDEN
A forbidden cell (not accessible to all explorators)

See Also:
Constant Field Values

WALL

public static final int WALL
A wall

See Also:
Constant Field Values
Constructor Detail

SpaceCell

public SpaceCell(int cellType)
Create a new cell

Parameters:
cellType - cell type (ACCESSIBLE, FORBIDDEN, WALL)
Method Detail

isAccessible

public boolean isAccessible()
Check if the cell is accessible.

Returns:
If the cell is accessible.

isForbidden

public boolean isForbidden()
Check if the cell is forbidden

Returns:
If the cell is forbidden.

isWall

public boolean isWall()
Check if the cell is a wall

Returns:
If the cell is a wall.

setCellType

public void setCellType(int cellType)
Sets the cell type (SpaceCell.ACCESSIBLE - SpaceCell.FORBIDDEN - SpaceCell.WALL)

Parameters:
cellType - The cell type to set (SpaceCell.ACCESSIBLE - SpaceCell.FORBIDDEN - SpaceCell.WALL)

cellType

public int cellType()
Check the cell type

Returns:
The cell type (SpaceCell.ACCESSIBLE - SpaceCell.FORBIDDEN - SpaceCell.WALL)