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/simulation/DaedalusSimulation.java | 6 +----- src/ch/epfl/maze/simulation/MazeSimulation.java | 4 +--- src/ch/epfl/maze/simulation/Simulation.java | 10 +--------- 3 files changed, 3 insertions(+), 17 deletions(-) (limited to 'src/ch/epfl/maze/simulation') diff --git a/src/ch/epfl/maze/simulation/DaedalusSimulation.java b/src/ch/epfl/maze/simulation/DaedalusSimulation.java index 8b60b57..90ff4a7 100644 --- a/src/ch/epfl/maze/simulation/DaedalusSimulation.java +++ b/src/ch/epfl/maze/simulation/DaedalusSimulation.java @@ -13,7 +13,6 @@ import java.util.*; * predator and prey in a Daedalus, as well as the animation by notifying * changes to it. The simulation finishes when every prey has been caught. */ - public final class DaedalusSimulation implements Simulation { /* limit to the step counter, over which the animals are considered lost */ @@ -33,7 +32,6 @@ public final class DaedalusSimulation implements Simulation { * * @param daedalus The daedalus to simulate */ - public DaedalusSimulation(Daedalus daedalus) { mDaedalus = daedalus; mArrivalTimes = new TreeMap>(Collections.reverseOrder()); @@ -162,7 +160,6 @@ public final class DaedalusSimulation implements Simulation { * @param listener The listener to which the function will notify the changes * (can be null) */ - private void movePredators(Animation listener) { List predators = mDaedalus.getPredators(); for (int i = 0; i < predators.size(); i++) { @@ -231,7 +228,6 @@ public final class DaedalusSimulation implements Simulation { * @param listener The listener to which the function will notify the changes * (can be null) */ - private void movePreys(Animation listener) { List preys = mDaedalus.getPreys(); Action action; @@ -303,7 +299,6 @@ public final class DaedalusSimulation implements Simulation { * @param listener The listener to which the function will notify the changes * (can be null) */ - private void checkCollisions(Animation listener) { List predators = mDaedalus.getPredators(); List preys = mDaedalus.getPreys(); @@ -346,4 +341,5 @@ public final class DaedalusSimulation implements Simulation { } } } + } diff --git a/src/ch/epfl/maze/simulation/MazeSimulation.java b/src/ch/epfl/maze/simulation/MazeSimulation.java index 3fd0e52..2108f54 100644 --- a/src/ch/epfl/maze/simulation/MazeSimulation.java +++ b/src/ch/epfl/maze/simulation/MazeSimulation.java @@ -18,7 +18,6 @@ import java.util.TreeMap; * the animation by notifying the changes to it. The simulation finishes when * every animal has found the exit. */ - public final class MazeSimulation implements Simulation { /* limit to the step counter, over which the animals are considered lost */ @@ -34,7 +33,6 @@ public final class MazeSimulation implements Simulation { * * @param maze The maze to simulate */ - public MazeSimulation(Maze maze) { mMaze = maze; mArrivalTimes = new TreeMap>(); @@ -140,7 +138,6 @@ public final class MazeSimulation implements Simulation { * @param listener The listener to which the function will notify the changes * (can be null) */ - private void moveAnimals(Animation listener) { List animals = mMaze.getAnimals(); for (int i = 0; i < animals.size(); i++) { @@ -205,4 +202,5 @@ public final class MazeSimulation implements Simulation { } } } + } diff --git a/src/ch/epfl/maze/simulation/Simulation.java b/src/ch/epfl/maze/simulation/Simulation.java index ab2fb84..d373d2f 100644 --- a/src/ch/epfl/maze/simulation/Simulation.java +++ b/src/ch/epfl/maze/simulation/Simulation.java @@ -11,7 +11,6 @@ import java.util.Map; * The {@code Simulation} interface defines a set of rules that must be * fulfilled in order to be displayed. */ - public interface Simulation { /** @@ -21,7 +20,6 @@ public interface Simulation { * @param listener The listener to which the function will notify the changes * (can be null) */ - public void move(Animation listener); /** @@ -29,7 +27,6 @@ public interface Simulation { * * @return true if no more moves can be made, false otherwise */ - public boolean isOver(); /** @@ -37,7 +34,6 @@ public interface Simulation { * * @return The {@code World} that is being simulated */ - public World getWorld(); /** @@ -45,7 +41,6 @@ public interface Simulation { * * @return The current step counter */ - public int getSteps(); /** @@ -55,7 +50,6 @@ public interface Simulation { * @return Map of steps done by animals which have accomplished the * simulation */ - public Map> getArrivalTimes(); /** @@ -65,18 +59,16 @@ public interface Simulation { * @return A {@code String} containing the top 10 animals which have * accomplished the simulation */ - public String getRecordTable(); /** * Restarts the simulation from the beginning. */ - public void restart(); /** * Stops abruptly the simulation. */ - public void stop(); + } -- cgit v1.2.3