Class Cell

java.lang.Object
   |
   +----Cell

class Cell
extends Object
implements InfoTarget
A single cell in the grid. This is not an interface object, just an internal representation. RobotWorld has an array of these.

Author:
Peter Sagerson, petersag@wpi.edu

Variable Index

 o beepers
The number of beepers in this cell.
 o debris
 o robot
A reference to the robot occupying the cell, if any.
 o wall
True if there is a wall occupying this cell.
 o x
Location of the Cell in the grid.
 o y
Location of the Cell in the grid.

Constructor Index

 o Cell(int, int)
Initial conditions for the Cell: no robot, no wall, 0 beepers.

Method Index

 o buildInfoString()
From InfoTarget.
 o buildVariableString()
Required by InfoTarget.
 o getX()
From InfoTarget.
 o getY()
From InfoTarget.

Variables

 o x
 int x
Location of the Cell in the grid.

 o y
 int y
Location of the Cell in the grid.

 o robot
 public Robot robot
A reference to the robot occupying the cell, if any.

 o wall
 public boolean wall
True if there is a wall occupying this cell.

 o beepers
 public int beepers
The number of beepers in this cell.

 o debris
 public String debris

Constructors

 o Cell
 public Cell(int inX,
             int inY)
Initial conditions for the Cell: no robot, no wall, 0 beepers.

Methods

 o getX
 public int getX()
From InfoTarget. Returns x.

 o getY
 public int getY()
From InfoTarget. Returns y.

 o buildInfoString
 public String buildInfoString()
From InfoTarget. Returns a string that describes this Cell. The string will be displayed in the interface's info box.

 o buildVariableString
 public String buildVariableString()
Required by InfoTarget.

Returns:
An empty string.
See Also:
InfoTarget