Environments
Class Cell

java.lang.Object
  |
  +--Environments.Cell
All Implemented Interfaces:
Drawable

public class Cell
extends java.lang.Object
implements Drawable

This class is used to represent a cell of a Woods Environment. It is useful if you want to have a graphical display of the environment.

Author:
Olivier Sigaud and Pierre Gérard.

Field Summary
private  int content
           
protected  Environments.Coords coords
           
private  java.lang.String perception
           
 
Constructor Summary
Cell(int c, int x, int y)
           
 
Method Summary
 int getContent()
           
 java.lang.String getPerception()
           
 double getX()
          Get the X coordinate of the Drawable Object
 double getY()
          Get the X coordinate of the Drawable Object
 boolean isFoodCell()
           
 boolean isFreeCell()
           
 boolean isTrois()
           
 boolean isWallCell()
           
 void setContent(int b)
           
 void setPerception(java.lang.String p)
           
 void setY(int y)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

content

private int content

coords

protected Environments.Coords coords

perception

private java.lang.String perception
Constructor Detail

Cell

public Cell(int c,
            int x,
            int y)
Parameters:
c -
x -
y -
Method Detail

getX

public double getX()
Description copied from interface: Drawable
Get the X coordinate of the Drawable Object

Specified by:
getX in interface Drawable
Returns:
double

setY

public void setY(int y)

getY

public double getY()
Description copied from interface: Drawable
Get the X coordinate of the Drawable Object

Specified by:
getY in interface Drawable
Returns:
double

getContent

public int getContent()
Returns:
int

getPerception

public java.lang.String getPerception()
Returns:
String the perception that can be seen from that cell

setPerception

public void setPerception(java.lang.String p)
Parameters:
p - the perception that can be seen from that cell

isFreeCell

public boolean isFreeCell()
Returns:
boolean

isWallCell

public boolean isWallCell()
Returns:
boolean

isFoodCell

public boolean isFoodCell()
Returns:
boolean

isTrois

public boolean isTrois()
Returns:
boolean

setContent

public void setContent(int b)
Parameters:
b -

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
String