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.
Constructor Summary |
Cell(int c,
int x,
int y)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
content
private int content
coords
protected Environments.Coords coords
perception
private java.lang.String perception
Cell
public Cell(int c,
int x,
int y)
- Parameters:
c
- x
- y
-
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