From 42300e5b5c54895e47c079166c39835811862108 Mon Sep 17 00:00:00 2001 From: Leen Dereu Date: Thu, 8 Mar 2018 10:55:44 +0100 Subject: [PATCH] commentaar isValidLocation --- OGP1718-Worms/src/worms/model/Worm.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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); }