diff --git a/OGP1718-Worms/src/worms/model/Program.java b/OGP1718-Worms/src/worms/model/Program.java index a657806..1986c32 100644 --- a/OGP1718-Worms/src/worms/model/Program.java +++ b/OGP1718-Worms/src/worms/model/Program.java @@ -33,6 +33,19 @@ public class Program { proc.forEach(p -> procMap.put(p.getName(), p.getBody())); } + public Worm getWorm() { + return this.worm; + } + public Map getVariables() { + return this.varMap; + } + protected void setWorm(Worm worm) { + this.worm = worm; + } + protected void setActionHandler(IActionHandler actionHandler) { + this.actionHandler = actionHandler; + } + protected void execute() { enoughAP = true; @@ -226,21 +239,10 @@ public class Program { } - protected void setActionHandler(IActionHandler actionHandler) { - this.actionHandler = actionHandler; - } - public Worm getWorm() { - return this.worm; - } - protected void setWorm(Worm worm) { - this.worm = worm; - } - public Map getVariables() { - return this.varMap; - } + private class CallStackNode { private Iterator statementIterator; diff --git a/OGP1718-Worms/src/worms/model/Projectile.java b/OGP1718-Worms/src/worms/model/Projectile.java index 2d0b7e3..699510f 100644 --- a/OGP1718-Worms/src/worms/model/Projectile.java +++ b/OGP1718-Worms/src/worms/model/Projectile.java @@ -59,7 +59,7 @@ public abstract class Projectile extends GameObject implements IJumpable { * |result == orientation */ public double getOrientation() { - return orientation; + return this.orientation; } private final double orientation; @@ -159,7 +159,6 @@ public abstract class Projectile extends GameObject implements IJumpable { * | List worms = getWorld().getGameObjectsByClass(Worm.class) * |for (Worm worm: worms) * | if (this.getDistance(worm) < 0) - * | setLocation(newLocation) * | hit(worm) * * @throws IllegalStateException ... @@ -189,7 +188,6 @@ public abstract class Projectile extends GameObject implements IJumpable { for (Worm worm: worms) { if (this.getDistance(worm) < 0) { - setLocation(newLocation); hit(worm); } } @@ -273,7 +271,7 @@ public abstract class Projectile extends GameObject implements IJumpable { /** * @return ... - * result == getOrientation() < PI + * |result == getOrientation() < PI */ private boolean canJump() { return getOrientation() < PI; diff --git a/OGP1718-Worms/src/worms/model/World.java b/OGP1718-Worms/src/worms/model/World.java index 5602eeb..be599db 100644 --- a/OGP1718-Worms/src/worms/model/World.java +++ b/OGP1718-Worms/src/worms/model/World.java @@ -497,7 +497,6 @@ public class World { * @return ... * |result == getGameObjectsByClass(Worm.class) */ - @SuppressWarnings("unchecked") public List getWormList() { return getGameObjectsByClass(Worm.class); @@ -507,7 +506,6 @@ public class World { * @return ... * |result == getGameObjectsByClass(Food.class) */ - @SuppressWarnings("unchecked") public List getFoodList() { return getGameObjectsByClass(Food.class); diff --git a/OGP1718-Worms/src/worms/model/Worm.java b/OGP1718-Worms/src/worms/model/Worm.java index bf94317..765990a 100644 --- a/OGP1718-Worms/src/worms/model/Worm.java +++ b/OGP1718-Worms/src/worms/model/Worm.java @@ -804,6 +804,7 @@ public class Worm extends GameObject implements IJumpable{ } /** + * TODO FIXME * Decreases the hit points of the attacked worm (chosen by a coin). * * @param newLocation The new location of the jumped worm. diff --git a/OGP1718-Worms/src/worms/programs/ProgramFactory.java b/OGP1718-Worms/src/worms/programs/ProgramFactory.java index 8bb7d1f..17d1d35 100644 --- a/OGP1718-Worms/src/worms/programs/ProgramFactory.java +++ b/OGP1718-Worms/src/worms/programs/ProgramFactory.java @@ -24,19 +24,6 @@ public class ProgramFactory implements IProgramFactory { * @throws IllegalArgumentException ... * | */ - public Tuple(T1 item1, T2 item2) throws IllegalArgumentException { + public Tuple(T1 item1, T2 item2) { this.item1 = item1; this.item2 = item2;