commentaar Facade
This commit is contained in:
@@ -22,8 +22,8 @@ public class Facade implements IFacade {
|
||||
* the name of the new worm
|
||||
* @post the new worm has the given location, direction, name and radius
|
||||
* |new Worm(Tuple.create(location), direction, name, radius)
|
||||
* @throws ModelException
|
||||
* the location, direction, name or radius is not a valid location, direction, name or radius
|
||||
* @throws ModelException(e)
|
||||
* the worm throws an IllegalArgumentException
|
||||
* |catch(IllegalArgumentException e)
|
||||
*/
|
||||
@Override
|
||||
@@ -46,6 +46,11 @@ public class Facade implements IFacade {
|
||||
* the worm who is going to move
|
||||
* @param nbSteps
|
||||
* the number of steps the worm is going to take
|
||||
* @post the worm has taken the given number of steps
|
||||
* |worm.move(nbSteps)
|
||||
* @throws ModelException(e)
|
||||
* the worm throws an IllegalArgumentException
|
||||
* |catch(IllegalArgumentException e)
|
||||
*/
|
||||
@Override
|
||||
public void move(Worm worm, int nbSteps) throws ModelException {
|
||||
@@ -64,6 +69,8 @@ public class Facade implements IFacade {
|
||||
* the worm who is going to move
|
||||
* @param angle
|
||||
* the angle the worm should turn
|
||||
* @post the worm has turned with the given angle
|
||||
* |worm.turn(angle)
|
||||
*/
|
||||
@Override
|
||||
public void turn(Worm worm, double angle) throws ModelException {
|
||||
@@ -76,6 +83,10 @@ public class Facade implements IFacade {
|
||||
*
|
||||
* @param worm
|
||||
* the worm who is going to move
|
||||
* @post the worm has jumped
|
||||
* @throws ModelException(e)
|
||||
* the worm throws an IllegalStateException
|
||||
* |catch(IllegalStateException e)
|
||||
*/
|
||||
@Override
|
||||
public void jump(Worm worm) throws ModelException {
|
||||
@@ -93,6 +104,9 @@ public class Facade implements IFacade {
|
||||
*
|
||||
* @param worm
|
||||
* the worm who is going to move
|
||||
* @throws ModelException(e)
|
||||
* the worm throws an IllegalStateException
|
||||
* |catch(IllegalStateException e)
|
||||
*/
|
||||
@Override
|
||||
public double getJumpTime(Worm worm) throws ModelException {
|
||||
@@ -114,6 +128,9 @@ public class Facade implements IFacade {
|
||||
* the time the worm should jump
|
||||
* @return An array with two elements, with the first element being the
|
||||
* x-coordinate and the second element the y-coordinate.
|
||||
* @throws ModelException(e)
|
||||
* the worm throws an IllegalArgumentException
|
||||
* |catch (IllegalArgumentException e)
|
||||
*/
|
||||
@Override
|
||||
public double[] getJumpStep(Worm worm, double t) throws ModelException {
|
||||
@@ -178,6 +195,11 @@ public class Facade implements IFacade {
|
||||
* the worm who is going to move
|
||||
* @param newRadius
|
||||
* the new radius of the worm
|
||||
* @post the new radius is equal to the given newRadius
|
||||
* |worm.setRadius(newRadius)
|
||||
* @throws ModelException(e)
|
||||
* the worm throws an IllegalArgumentException
|
||||
* |catch(IllegalArgumentException e)
|
||||
*/
|
||||
@Override
|
||||
public void setRadius(Worm worm, double newRadius) throws ModelException {
|
||||
@@ -208,6 +230,8 @@ public class Facade implements IFacade {
|
||||
* the worm who is going to move
|
||||
* @param delta
|
||||
* the value that schould be decreased
|
||||
* @post the action points are decreased with delta
|
||||
* |worm.decreaseActionPoints((int) delta)
|
||||
*/
|
||||
@Override
|
||||
public void decreaseNbActionPoints(Worm worm, long delta) throws ModelException {
|
||||
@@ -243,6 +267,11 @@ public class Facade implements IFacade {
|
||||
* the worm who is going to move
|
||||
* @param newName
|
||||
* the new name for the worm
|
||||
* @post the new name of the worm is equal to the given newName
|
||||
* |worm.setName(newName)
|
||||
* @throws ModelException(e)
|
||||
* the worm throws an IllegalNameException
|
||||
* |catch(IllegalNameException e)
|
||||
*/
|
||||
@Override
|
||||
public void rename(Worm worm, String newName) throws ModelException {
|
||||
|
Reference in New Issue
Block a user