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
* worm followed by the y-coordinate of the position of the new worm * An array containing the x-coordinate of the position of the new
* (in meter) * worm followed by the y-coordinate of the position of the new worm
* @param direction The direction of the new worm (in radians) * (in meter)
* @param radius The radius of the new worm (in meter) * @param direction
* @param name ... * The direction of the new worm (in radians)
* @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 {
@@ -32,9 +36,11 @@ 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 {
@@ -48,9 +54,11 @@ 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 {
@@ -60,8 +68,9 @@ 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 {
@@ -76,8 +85,9 @@ 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 {
@@ -92,11 +102,13 @@ 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.
*/ */
@Override @Override
public double[] getJumpStep(Worm worm, double t) throws ModelException { public double[] getJumpStep(Worm worm, double t) throws ModelException {
@@ -112,8 +124,9 @@ 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 {
@@ -122,8 +135,9 @@ 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 {
@@ -132,8 +146,9 @@ 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 {
@@ -142,8 +157,9 @@ 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 {
@@ -152,9 +168,11 @@ 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 {
@@ -168,8 +186,9 @@ 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 {
@@ -179,9 +198,11 @@ 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 {
@@ -190,8 +211,9 @@ 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 {
@@ -200,8 +222,9 @@ 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 {
@@ -210,9 +233,11 @@ 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 {
@@ -226,8 +251,9 @@ 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 {