public class MapField
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
grassDensity |
private boolean |
isNearWater |
private Humidity |
localHumidity |
private OccupantType |
occupant |
private int |
x |
private int |
y |
Constructor and Description |
---|
MapField(int xstart,
int ystart,
OccupantType newOccupant,
Humidity startingHumidity,
int startingGrassDensity)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateGrassDensity()
Recalculate the grass density based on humidity values.
|
int |
getGrassDensity() |
java.util.HashMap<java.lang.String,java.lang.Integer> |
getInfo()
Return a hash map containing all the information about this field.
|
Humidity |
getLocalHumidity() |
OccupantType |
getOccupant() |
boolean |
nearWater() |
void |
reduceGrassDensity(int amount) |
void |
setLocalHumidity(Humidity localHumidity) |
void |
setNearWater(boolean newValue) |
void |
setOccupant(OccupantType occupant) |
private int x
private int y
private int grassDensity
private boolean isNearWater
private Humidity localHumidity
private OccupantType occupant
public MapField(int xstart, int ystart, OccupantType newOccupant, Humidity startingHumidity, int startingGrassDensity)
public void calculateGrassDensity()
public java.util.HashMap<java.lang.String,java.lang.Integer> getInfo()
public void setNearWater(boolean newValue)
public boolean nearWater()
public int getGrassDensity()
public OccupantType getOccupant()
public void setOccupant(OccupantType occupant)
public Humidity getLocalHumidity()
public void setLocalHumidity(Humidity localHumidity)
public void reduceGrassDensity(int amount)