small changes

This commit is contained in:
2018-03-11 22:51:58 +01:00
parent a40b6125c7
commit f836afbcdb
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@@ -28,7 +28,7 @@ import static java.lang.Math.*;
* Arthur Bols 1e bachelor Informatica * Arthur Bols 1e bachelor Informatica
* Leen Dereu 1e bachelor Informatica * Leen Dereu 1e bachelor Informatica
* *
* URL: TODO * URL: https://github.com/KUL-ogp/ogp1718-project-bols-dereu
*/ */
public class Worm { public class Worm {
@@ -575,12 +575,12 @@ public class Worm {
*/ */
public void move(int numberSteps) throws IllegalArgumentException { public void move(int numberSteps) throws IllegalArgumentException {
if (numberSteps < 0) if (numberSteps < 0)
throw new IllegalArgumentException(); // TODO add decent exception msg throw new IllegalArgumentException();
long cost = (long) ceil(abs(cos(getOrientation())) + abs(4 * sin(getOrientation()))) * numberSteps; long cost = (long) ceil(abs(cos(getOrientation())) + abs(4 * sin(getOrientation()))) * numberSteps;
if (cost > getActionPoints()) if (cost > getActionPoints())
throw new IllegalArgumentException(); // TODO add decent exception msg throw new IllegalArgumentException();
double distanceX = this.radius * cos(getOrientation()); double distanceX = this.radius * cos(getOrientation());
double distanceY = this.radius * sin(getOrientation()); double distanceY = this.radius * sin(getOrientation());