Merge branch 'master' of gitlab.principis.be:OGP/worms
This commit is contained in:
@@ -5,7 +5,6 @@ import worms.util.Coordinate;
|
||||
public class Food extends GameObject {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param world
|
||||
* @param location
|
||||
*
|
||||
@@ -26,21 +25,40 @@ public class Food extends GameObject {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return ...
|
||||
* |result == this.poisonous
|
||||
*/
|
||||
public boolean isPoisonous() {
|
||||
return this.poisonous;
|
||||
}
|
||||
|
||||
/**
|
||||
* @post ...
|
||||
* |poisonous == true
|
||||
*/
|
||||
public void poison() {
|
||||
this.poisonous = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @post ...
|
||||
* |poisonous == false
|
||||
*/
|
||||
public void heal() {
|
||||
this.poisonous = false;
|
||||
}
|
||||
|
||||
private boolean poisonous = false;
|
||||
|
||||
|
||||
/**
|
||||
* @param location
|
||||
*
|
||||
* @return ...
|
||||
* |if (getWorld() != null
|
||||
* | result == super.isValidLocation(location) && getWorld().isAdjacent(location, getRadius())
|
||||
* |result == super.isValidLocation(location)
|
||||
*/
|
||||
@Override
|
||||
protected boolean isValidLocation(Coordinate location) {
|
||||
if (getWorld() != null) return super.isValidLocation(location) && getWorld().isAdjacent(location, getRadius());
|
||||
|
Reference in New Issue
Block a user