diff --git a/OGP1718-Worms/src/worms/model/Worm.java b/OGP1718-Worms/src/worms/model/Worm.java index a2ff2de..2fcdac5 100644 --- a/OGP1718-Worms/src/worms/model/Worm.java +++ b/OGP1718-Worms/src/worms/model/Worm.java @@ -243,6 +243,15 @@ public class Worm { setMass(radius); } + /** + * check whether the given radius is a valid radius for the worm + * + * @param radius + * the radius to check + * @return True if and only if the radius is bigger then the minimum radius + * (or equal) and the radius is a number + * |result == (radius >= this.minimumRadius && !Double.isNaN(radius)) + */ private boolean isValidRadius(double radius) { return radius >= this.minimumRadius && !Double.isNaN(radius); } @@ -256,6 +265,14 @@ public class Worm { return this.minimumRadius; } + /** + * check whether the given radius is a valid minimum radius for the worm + * + * @param radius + * the radius to check + * @return True if and only if the radius is a number and the radius is bigger then 0 + * |result == ((!Double.isNaN(radius)) && (radius > 0)) + */ private boolean isValidMinimumRadius(double radius) { return !Double.isNaN(radius) && radius > 0; }