small changes
This commit is contained in:
BIN
Dereu_Bols.jar
BIN
Dereu_Bols.jar
Binary file not shown.
@@ -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());
|
||||||
|
Reference in New Issue
Block a user