diff --git a/OGP1718-Worms/src/worms/model/Food.java b/OGP1718-Worms/src/worms/model/Food.java index e8d4ff8..aa6c6fc 100644 --- a/OGP1718-Worms/src/worms/model/Food.java +++ b/OGP1718-Worms/src/worms/model/Food.java @@ -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());