From 00e082400f454f4850e3605c480f5ee1b49ed67e Mon Sep 17 00:00:00 2001 From: Leen Dereu Date: Wed, 7 Mar 2018 16:01:24 +0100 Subject: [PATCH 1/4] Classes in juiste map zetten --- {src => OGP1718-Worms/src}/IllegalNameException.java | 0 {src => OGP1718-Worms/src}/Main.java | 0 {src => OGP1718-Worms/src}/Tuple.java | 0 {src => OGP1718-Worms/src}/Worm.java | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {src => OGP1718-Worms/src}/IllegalNameException.java (100%) rename {src => OGP1718-Worms/src}/Main.java (100%) rename {src => OGP1718-Worms/src}/Tuple.java (100%) rename {src => OGP1718-Worms/src}/Worm.java (100%) diff --git a/src/IllegalNameException.java b/OGP1718-Worms/src/IllegalNameException.java similarity index 100% rename from src/IllegalNameException.java rename to OGP1718-Worms/src/IllegalNameException.java diff --git a/src/Main.java b/OGP1718-Worms/src/Main.java similarity index 100% rename from src/Main.java rename to OGP1718-Worms/src/Main.java diff --git a/src/Tuple.java b/OGP1718-Worms/src/Tuple.java similarity index 100% rename from src/Tuple.java rename to OGP1718-Worms/src/Tuple.java diff --git a/src/Worm.java b/OGP1718-Worms/src/Worm.java similarity index 100% rename from src/Worm.java rename to OGP1718-Worms/src/Worm.java From 4429f2dc0f30f4830f942c5b3b90a118a10c7468 Mon Sep 17 00:00:00 2001 From: Leen Dereu Date: Wed, 7 Mar 2018 16:15:44 +0100 Subject: [PATCH 2/4] commentaar variabelen --- OGP1718-Worms/src/Worm.java | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/OGP1718-Worms/src/Worm.java b/OGP1718-Worms/src/Worm.java index abf37de..f6393af 100644 --- a/OGP1718-Worms/src/Worm.java +++ b/OGP1718-Worms/src/Worm.java @@ -9,20 +9,39 @@ public class Worm { private Tuple location; private Tuple oldLocation; - // Orientation + /** + * this variable contains the orientation of the worm + */ private double orientation; - // shape + /** + * this variable contains the radius of the worm + */ private double radius; + + /** + * this variable contains the minimum value of the radius + */ private final double minRadius; - // mass + + /** + * this variable contains the mass of the worm + */ private double mass; - // points + /** + * this variable contains the current action points of the worm + */ private int points; + + /** + * this variable contains the maximum points a worm can have + */ private int maxPoints; - // name + /** + * this variable contains the name of the worm + */ private String name; //=================================================================================== From faba6f0f11a03d93b190b3f6683beab39db7425c Mon Sep 17 00:00:00 2001 From: Leen Dereu Date: Wed, 7 Mar 2018 16:21:44 +0100 Subject: [PATCH 3/4] Basis commentaar locatie --- OGP1718-Worms/src/Worm.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OGP1718-Worms/src/Worm.java b/OGP1718-Worms/src/Worm.java index f6393af..55e15b0 100644 --- a/OGP1718-Worms/src/Worm.java +++ b/OGP1718-Worms/src/Worm.java @@ -105,6 +105,13 @@ public class Worm { return this.location; } + /** + * sets the location of the worm to the given location + * + * @param location + * + * @throws IllegalArgumentException + */ private void setLocation(Tuple location) throws IllegalArgumentException { if (location.equals(null)) From 2821945d7f1943c4eb1f955ca113210478c84326 Mon Sep 17 00:00:00 2001 From: Leen Dereu Date: Wed, 7 Mar 2018 16:50:49 +0100 Subject: [PATCH 4/4] commentaar hoofding en orientation --- OGP1718-Worms/src/Worm.java | 37 +++++++++++++++++++++++++++++++++---- docs/samenvatting.md | 2 +- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/OGP1718-Worms/src/Worm.java b/OGP1718-Worms/src/Worm.java index 55e15b0..63a7eca 100644 --- a/OGP1718-Worms/src/Worm.java +++ b/OGP1718-Worms/src/Worm.java @@ -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); diff --git a/docs/samenvatting.md b/docs/samenvatting.md index 47581da..fdb5239 100644 --- a/docs/samenvatting.md +++ b/docs/samenvatting.md @@ -36,7 +36,7 @@ ### orientation orientation hoek theta (radialen) - rechts: 0 boven: pi/2 + rechts: th0 boven: pi/2 nominaal 0..2pi