commentaar hoofding en orientation
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
public class Worm {
|
||||
|
||||
/**
|
||||
* a class with the specifications of the worm
|
||||
*
|
||||
* @invar the location of the worm must be a valid location
|
||||
* |...
|
||||
* @invar
|
||||
*
|
||||
* @version 1.0
|
||||
* @author Arthur Bols and Leen Dereu
|
||||
*/
|
||||
|
||||
// region properties
|
||||
//===================================================================================
|
||||
@@ -127,14 +136,25 @@ public class Worm {
|
||||
//===================================================================================
|
||||
|
||||
/**
|
||||
* set the orientation of the worm to the given orientation
|
||||
*
|
||||
* @param orientation
|
||||
* | ...
|
||||
*
|
||||
* the new orientation of the worm
|
||||
* @pre the given orientation must be a valid orientation for any worm
|
||||
* |isValidOrientation(orientation)
|
||||
* @post the new orientation of the worm must be equal to the given orientation
|
||||
* |new.getOrientation() == orientation
|
||||
*/
|
||||
public void setOrientation(double orientation) {
|
||||
|
||||
this.orientation = orientation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the orientation of the worm
|
||||
*
|
||||
*/
|
||||
@Basic
|
||||
public double getOrientation() {
|
||||
return orientation;
|
||||
}
|
||||
@@ -147,11 +167,20 @@ public class Worm {
|
||||
|
||||
// region Shape mass/radius
|
||||
//===================================================================================
|
||||
|
||||
|
||||
/**
|
||||
* @return the radius of the worm
|
||||
*/
|
||||
@Basic
|
||||
public double getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param radius
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public void setRadius(double radius) throws IllegalArgumentException {
|
||||
if (radius < this.minRadius)
|
||||
throw new IllegalArgumentException("Radius is smaller than " + this.minRadius);
|
||||
|
Reference in New Issue
Block a user