commentaar isValidLocation
This commit is contained in:
@@ -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(Tuple<Double, Double>location) {
|
||||
return location != null && !Double.isNaN(location.item1) && !Double.isNaN(location.item2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user