diff --git a/OGP1718-Worms/src/worms/model/Worm.java b/OGP1718-Worms/src/worms/model/Worm.java index 6444fb5..37fd9ef 100644 --- a/OGP1718-Worms/src/worms/model/Worm.java +++ b/OGP1718-Worms/src/worms/model/Worm.java @@ -592,9 +592,15 @@ public class Worm { } /** + *return a boolean reflecting whether the worm can accept the given angle to turn * * @param angle - * @return ... + * the angle to be checked + * @return true if and only if the given angle is between 0 (including) and 2pi, + * the angle is a number and the current number of action points is high enough to turn + * |result == ( (0 <= angle) && (angle < (2 * PI)) && + | (!Double.isNaN(angle)) && + | (getActionPoints() - (long) ceil(toDegrees(angle) / 6) >= 0) ) */ private boolean canTurn(double angle) { return 0 <= angle && angle < (2 * PI) && diff --git a/docs/TODO.txt b/docs/TODO.txt index cf33b9c..f6981d4 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -3,8 +3,8 @@ - Worm DONE - getMaxActionPoints DONE - decreaseActionPoints DONE - - canTurn - - Tuple (methode) + - canTurn DONE + - Tuple (methode) * testen schrijven * documentatie Facade * is Facade klaar?