From bc477506342411e9156b3230d847cb92bcb8e5f9 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Tue, 24 Nov 2015 11:11:17 +0100 Subject: Reformat code --- src/ch/epfl/maze/physical/zoo/Hamster.java | 5 +---- src/ch/epfl/maze/physical/zoo/Monkey.java | 5 +---- src/ch/epfl/maze/physical/zoo/Panda.java | 2 +- src/ch/epfl/maze/physical/zoo/SpaceInvader.java | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) (limited to 'src/ch/epfl/maze/physical/zoo') diff --git a/src/ch/epfl/maze/physical/zoo/Hamster.java b/src/ch/epfl/maze/physical/zoo/Hamster.java index 3c903f5..7fa0b0d 100644 --- a/src/ch/epfl/maze/physical/zoo/Hamster.java +++ b/src/ch/epfl/maze/physical/zoo/Hamster.java @@ -16,7 +16,6 @@ import java.util.stream.Collectors; * * @author Pacien TRAN-GIRARD */ - public class Hamster extends ProbabilisticAnimal { private final List deadPaths; @@ -26,7 +25,6 @@ public class Hamster extends ProbabilisticAnimal { * * @param position Starting position of the hamster in the labyrinth */ - public Hamster(Vector2D position) { super(position); this.deadPaths = new ArrayList<>(); @@ -38,7 +36,6 @@ public class Hamster extends ProbabilisticAnimal { * @param choices An array of choices * @return An array of smart choices */ - private Direction[] excludeDeadPaths(Direction[] choices) { return (new ArrayList<>(Arrays.asList(choices))) .stream() @@ -51,7 +48,6 @@ public class Hamster extends ProbabilisticAnimal { * Moves without retracing directly its steps and by avoiding the dead-ends * it learns during its journey. */ - @Override public Direction move(Direction[] choices) { Direction[] smartChoices = this.excludeDeadPaths(choices); @@ -63,4 +59,5 @@ public class Hamster extends ProbabilisticAnimal { public Animal copy() { return new Hamster(this.getPosition()); } + } diff --git a/src/ch/epfl/maze/physical/zoo/Monkey.java b/src/ch/epfl/maze/physical/zoo/Monkey.java index 7bcf090..196b028 100644 --- a/src/ch/epfl/maze/physical/zoo/Monkey.java +++ b/src/ch/epfl/maze/physical/zoo/Monkey.java @@ -13,7 +13,6 @@ import java.util.List; * * @author Pacien TRAN-GIRARD */ - public class Monkey extends Animal { private Direction currentDirection; @@ -23,7 +22,6 @@ public class Monkey extends Animal { * * @param position Starting position of the monkey in the labyrinth */ - public Monkey(Vector2D position) { super(position); this.currentDirection = Direction.NONE; @@ -35,7 +33,6 @@ public class Monkey extends Animal { * @param choices An array of possible directions * @return The currentDirection to take according to the "left paw rule" */ - private Direction followLeft(Direction[] choices) { List choiceList = new ArrayList<>(Arrays.asList(choices)); Direction dir = this.currentDirection.rotateLeft(); @@ -60,7 +57,6 @@ public class Monkey extends Animal { /** * Moves according to the relative left wall that the monkey has to follow. */ - @Override public Direction move(Direction[] choices) { this.currentDirection = this.findDirection(choices); @@ -71,4 +67,5 @@ public class Monkey extends Animal { public Animal copy() { return new Monkey(this.getPosition()); } + } diff --git a/src/ch/epfl/maze/physical/zoo/Panda.java b/src/ch/epfl/maze/physical/zoo/Panda.java index dc1198e..aa35efe 100644 --- a/src/ch/epfl/maze/physical/zoo/Panda.java +++ b/src/ch/epfl/maze/physical/zoo/Panda.java @@ -104,7 +104,7 @@ public class Panda extends ProbabilisticAnimal { * avoiding intersections over-marking. * * @param choices An array of possible Directions - * @param choice The selected Direction + * @param choice The selected Direction * @return T(the current position should be marked) */ private boolean shouldMarkCurrentPosition(Direction[] choices, Direction choice) { diff --git a/src/ch/epfl/maze/physical/zoo/SpaceInvader.java b/src/ch/epfl/maze/physical/zoo/SpaceInvader.java index f5963b1..d03d280 100644 --- a/src/ch/epfl/maze/physical/zoo/SpaceInvader.java +++ b/src/ch/epfl/maze/physical/zoo/SpaceInvader.java @@ -18,7 +18,6 @@ import ch.epfl.maze.util.Vector2D; * * @see ch.epfl.maze.tests.Competition Competition */ - public class SpaceInvader extends Animal { /** @@ -26,7 +25,6 @@ public class SpaceInvader extends Animal { * * @param position Starting position of the mouse in the labyrinth */ - public SpaceInvader(Vector2D position) { super(position); // TODO (bonus) @@ -35,7 +33,6 @@ public class SpaceInvader extends Animal { /** * Moves according to (... please complete with as many details as you can). */ - @Override public Direction move(Direction[] choices) { // TODO (bonus) @@ -47,4 +44,5 @@ public class SpaceInvader extends Animal { // TODO (bonus) return null; } + } -- cgit v1.2.3