Merge branch 'master' of gitlab.principis.be:OGP/worms

This commit is contained in:
2018-03-11 17:48:49 +01:00

View File

@@ -10,12 +10,16 @@ public class Facade implements IFacade {
* Create and return a new worm that is positioned at the given location, looks * Create and return a new worm that is positioned at the given location, looks
* in the given direction, has the given radius and the given name. * in the given direction, has the given radius and the given name.
* *
* @param location An array containing the x-coordinate of the position of the new * @param location
* An array containing the x-coordinate of the position of the new
* worm followed by the y-coordinate of the position of the new worm * worm followed by the y-coordinate of the position of the new worm
* (in meter) * (in meter)
* @param direction The direction of the new worm (in radians) * @param direction
* @param radius The radius of the new worm (in meter) * The direction of the new worm (in radians)
* @param name ... * @param radius
* The radius of the new worm (in meter)
* @param name
* the name of the new worm
*/ */
@Override @Override
public Worm createWorm(double[] location, double direction, double radius, String name) throws ModelException { public Worm createWorm(double[] location, double direction, double radius, String name) throws ModelException {
@@ -33,8 +37,10 @@ public class Facade implements IFacade {
/** /**
* Moves the given worm by the given number of steps. * Moves the given worm by the given number of steps.
* *
* @param worm ... * @param worm
* @param nbSteps ... * the worm who is going to move
* @param nbSteps
* the number of steps the worm is going to take
*/ */
@Override @Override
public void move(Worm worm, int nbSteps) throws ModelException { public void move(Worm worm, int nbSteps) throws ModelException {
@@ -49,8 +55,10 @@ public class Facade implements IFacade {
/** /**
* Turns the given worm by the given angle. * Turns the given worm by the given angle.
* *
* @param worm ... * @param worm
* @param angle ... * the worm who is going to move
* @param angle
* the angle the worm should turn
*/ */
@Override @Override
public void turn(Worm worm, double angle) throws ModelException { public void turn(Worm worm, double angle) throws ModelException {
@@ -61,7 +69,8 @@ public class Facade implements IFacade {
/** /**
* Makes the given worm jump. * Makes the given worm jump.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public void jump(Worm worm) throws ModelException { public void jump(Worm worm) throws ModelException {
@@ -77,7 +86,8 @@ public class Facade implements IFacade {
* Returns the total amount of time (in seconds) that a jump of the given worm * Returns the total amount of time (in seconds) that a jump of the given worm
* would take. * would take.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public double getJumpTime(Worm worm) throws ModelException { public double getJumpTime(Worm worm) throws ModelException {
@@ -93,8 +103,10 @@ public class Facade implements IFacade {
/** /**
* Returns the location on the jump trajectory of the given worm after a time t. * Returns the location on the jump trajectory of the given worm after a time t.
* *
* @param worm ... * @param worm
* @param t ... * the worm who is going to move
* @param t
* the time the worm should jump
* @return An array with two elements, with the first element being the * @return An array with two elements, with the first element being the
* x-coordinate and the second element the y-coordinate. * x-coordinate and the second element the y-coordinate.
*/ */
@@ -113,7 +125,8 @@ public class Facade implements IFacade {
/** /**
* Returns the x-coordinate of the current location of the given worm. * Returns the x-coordinate of the current location of the given worm.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public double getX(Worm worm) throws ModelException { public double getX(Worm worm) throws ModelException {
@@ -123,7 +136,8 @@ public class Facade implements IFacade {
/** /**
* Returns the y-coordinate of the current location of the given worm. * Returns the y-coordinate of the current location of the given worm.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public double getY(Worm worm) throws ModelException { public double getY(Worm worm) throws ModelException {
@@ -133,7 +147,8 @@ public class Facade implements IFacade {
/** /**
* Returns the current orientation of the given worm (in radians). * Returns the current orientation of the given worm (in radians).
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public double getOrientation(Worm worm) throws ModelException { public double getOrientation(Worm worm) throws ModelException {
@@ -143,7 +158,8 @@ public class Facade implements IFacade {
/** /**
* Returns the radius of the given worm. * Returns the radius of the given worm.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public double getRadius(Worm worm) throws ModelException { public double getRadius(Worm worm) throws ModelException {
@@ -153,8 +169,10 @@ public class Facade implements IFacade {
/** /**
* Sets the radius of the given worm to the given value. * Sets the radius of the given worm to the given value.
* *
* @param worm ... * @param worm
* @param newRadius ... * the worm who is going to move
* @param newRadius
* the new radius of the worm
*/ */
@Override @Override
public void setRadius(Worm worm, double newRadius) throws ModelException { public void setRadius(Worm worm, double newRadius) throws ModelException {
@@ -169,7 +187,8 @@ public class Facade implements IFacade {
/** /**
* Returns the current number of action points of the given worm. * Returns the current number of action points of the given worm.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public long getNbActionPoints(Worm worm) throws ModelException { public long getNbActionPoints(Worm worm) throws ModelException {
@@ -180,8 +199,10 @@ public class Facade implements IFacade {
* Decreases the current number of action points of the given worm with the * Decreases the current number of action points of the given worm with the
* given delta. * given delta.
* *
* @param worm ... * @param worm
* @param delta ... * the worm who is going to move
* @param delta
* the value that schould be decreased
*/ */
@Override @Override
public void decreaseNbActionPoints(Worm worm, long delta) throws ModelException { public void decreaseNbActionPoints(Worm worm, long delta) throws ModelException {
@@ -191,7 +212,8 @@ public class Facade implements IFacade {
/** /**
* Returns the maximum number of action points of the given worm. * Returns the maximum number of action points of the given worm.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public long getMaxNbActionPoints(Worm worm) throws ModelException { public long getMaxNbActionPoints(Worm worm) throws ModelException {
@@ -201,7 +223,8 @@ public class Facade implements IFacade {
/** /**
* Returns the name the given worm. * Returns the name the given worm.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public String getName(Worm worm) throws ModelException { public String getName(Worm worm) throws ModelException {
@@ -211,8 +234,10 @@ public class Facade implements IFacade {
/** /**
* Renames the given worm. * Renames the given worm.
* *
* @param worm ... * @param worm
* @param newName ... * the worm who is going to move
* @param newName
* the new name for the worm
*/ */
@Override @Override
public void rename(Worm worm, String newName) throws ModelException { public void rename(Worm worm, String newName) throws ModelException {
@@ -227,7 +252,8 @@ public class Facade implements IFacade {
/** /**
* Returns the mass of the given worm. * Returns the mass of the given worm.
* *
* @param worm ... * @param worm
* the worm who is going to move
*/ */
@Override @Override
public double getMass(Worm worm) throws ModelException { public double getMass(Worm worm) throws ModelException {