From b2aef5ff1979c04c72edae76c0e2b1fcec5b18d8 Mon Sep 17 00:00:00 2001 From: Leen Dereu Date: Thu, 8 Mar 2018 11:21:31 +0100 Subject: [PATCH] commentaar shape --- OGP1718-Worms/src/worms/model/Worm.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; }