diff --git a/OGP1718-Worms/src/worms/model/Worm.java b/OGP1718-Worms/src/worms/model/Worm.java index 378eb35..a2ff2de 100644 --- a/OGP1718-Worms/src/worms/model/Worm.java +++ b/OGP1718-Worms/src/worms/model/Worm.java @@ -160,6 +160,15 @@ public class Worm { this.location = location; } + /** + * check whether the given location is a valid location for the worm + * + * @param location + * the location to check + * @return True if and only if the location is not equal to null and the coordinates of + * the worm are numbers + * |result == (location != null) && (!Double.isNaN(location.item1)) && (!Double.isNaN(location.item2)) + */ private boolean isValidLocation(Tuplelocation) { return location != null && !Double.isNaN(location.item1) && !Double.isNaN(location.item2); }