commentaar aanpassen

This commit is contained in:
Leen Dereu
2018-03-11 21:20:57 +01:00
parent 6e32d5f053
commit d5873fd766

View File

@@ -556,18 +556,18 @@ public class Worm {
* the old x-coordinate plus the number of steps multiplied with the distance
* that the x-coordinate schould move (distance is equal to the radius multiplied
* with the cosinus of the orientation)
* |distanceX = this.radius * Math.cos(this.orientation)
* |new.xCoordinate = this.location.item1 + numberSteps * distanceX
* |distanceX = this.radius * cos(getOrientation())
* |new.xCoordinate = getLocation().item1 + numberSteps * distanceX
* @post the y-coordinate of the new location of the worm schould be the location of
* the old y-coordinate plus the number of steps multiplied with the distance
* that the y-coordinate schould move (distance is equal to the radius multiplied
* with the sinus of the orientation)
* |distanceY = this.radius * Math.sin(this.orientation)
* |new.yCoordinate = this.location.item2 + numberSteps * distanceY
* |distanceY = this.radius * sin(getOrientation())
* |new.yCoordinate = getLocation().item2 + numberSteps * distanceY
* @post the current value of action actionPoints has changed. The current value of action actionPoints
* minus the cost of moving (abs(cos(theta)) + abs(4 sin(theta)))
* |value = (int) Math.ceil(Math.abs(Math.cos(this.orientation)) + Math.abs(4 * Math.sin(this.orientation)))
* |setActionPoints(this.actionPoints - value)
* |cost = (long) ceil(abs(cos(getOrientation())) + abs(4 * sin(getOrientation()))) * numberSteps
* |subtractActionPoints(cost)
* @throws IllegalArgumentException
* when the total of steps is lower then 0 or when the cost of action point is more
* then the current value of action point