commentaar aanpassen
This commit is contained in:
@@ -556,18 +556,18 @@ public class Worm {
|
|||||||
* the old x-coordinate plus the number of steps multiplied with the distance
|
* 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
|
* that the x-coordinate schould move (distance is equal to the radius multiplied
|
||||||
* with the cosinus of the orientation)
|
* with the cosinus of the orientation)
|
||||||
* |distanceX = this.radius * Math.cos(this.orientation)
|
* |distanceX = this.radius * cos(getOrientation())
|
||||||
* |new.xCoordinate = this.location.item1 + numberSteps * distanceX
|
* |new.xCoordinate = getLocation().item1 + numberSteps * distanceX
|
||||||
* @post the y-coordinate of the new location of the worm schould be the location of
|
* @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
|
* 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
|
* that the y-coordinate schould move (distance is equal to the radius multiplied
|
||||||
* with the sinus of the orientation)
|
* with the sinus of the orientation)
|
||||||
* |distanceY = this.radius * Math.sin(this.orientation)
|
* |distanceY = this.radius * sin(getOrientation())
|
||||||
* |new.yCoordinate = this.location.item2 + numberSteps * distanceY
|
* |new.yCoordinate = getLocation().item2 + numberSteps * distanceY
|
||||||
* @post the current value of action actionPoints has changed. The current value of action actionPoints
|
* @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)))
|
* 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)))
|
* |cost = (long) ceil(abs(cos(getOrientation())) + abs(4 * sin(getOrientation()))) * numberSteps
|
||||||
* |setActionPoints(this.actionPoints - value)
|
* |subtractActionPoints(cost)
|
||||||
* @throws IllegalArgumentException
|
* @throws IllegalArgumentException
|
||||||
* when the total of steps is lower then 0 or when the cost of action point is more
|
* 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
|
* then the current value of action point
|
||||||
|
Reference in New Issue
Block a user