From 90bd766f361083f6fd9e39ff080c83fcc606832f Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sat, 21 Nov 2015 10:44:42 +0100 Subject: Reformat imported code --- src/ch/epfl/maze/main/Program.java | 124 ++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 65 deletions(-) (limited to 'src/ch/epfl/maze/main/Program.java') diff --git a/src/ch/epfl/maze/main/Program.java b/src/ch/epfl/maze/main/Program.java index a295ae2..db43a68 100644 --- a/src/ch/epfl/maze/main/Program.java +++ b/src/ch/epfl/maze/main/Program.java @@ -3,12 +3,7 @@ package ch.epfl.maze.main; import ch.epfl.maze.graphics.Display; import ch.epfl.maze.physical.Daedalus; import ch.epfl.maze.physical.Maze; -import ch.epfl.maze.physical.pacman.Blinky; -import ch.epfl.maze.physical.pacman.Clyde; -import ch.epfl.maze.physical.pacman.Inky; -import ch.epfl.maze.physical.pacman.PacMan; -import ch.epfl.maze.physical.pacman.Pinky; -import ch.epfl.maze.physical.zoo.Bear; +import ch.epfl.maze.physical.pacman.*; import ch.epfl.maze.physical.zoo.Hamster; import ch.epfl.maze.physical.zoo.Monkey; import ch.epfl.maze.physical.zoo.Mouse; @@ -21,86 +16,85 @@ import ch.epfl.maze.util.Vector2D; /** * Mini-project main program that will run the simulations on a {@code Display}. - * */ public class Program { - /** - * Runs one of the two available simulations - * - * @see #getMazeSimulation() - * @see #getDaedalusSimulation() - */ + /** + * Runs one of the two available simulations + * + * @see #getMazeSimulation() + * @see #getDaedalusSimulation() + */ - public static void main(String[] args) { - Simulation simulation; + public static void main(String[] args) { + Simulation simulation; - simulation = getMazeSimulation(); - //simulation = getDaedalusSimulation(); + simulation = getMazeSimulation(); + //simulation = getDaedalusSimulation(); - Display display = new Display(simulation); - display.run(); - } + Display display = new Display(simulation); + display.run(); + } - /** - * Creates a {@code MazeSimulation} with every animal implementations. - * - * @return A {@code MazeSimulation} to display - */ + /** + * Creates a {@code MazeSimulation} with every animal implementations. + * + * @return A {@code MazeSimulation} to display + */ - public static Simulation getMazeSimulation() { - int[][] labyrinth = LabyrinthGenerator.getMedium(); - Maze m = new Maze(labyrinth); - Simulation simulation = new MazeSimulation(m); + public static Simulation getMazeSimulation() { + int[][] labyrinth = LabyrinthGenerator.getMedium(); + Maze m = new Maze(labyrinth); + Simulation simulation = new MazeSimulation(m); - // adds a Mouse - m.addAnimal(new Mouse(m.getStart())); + // adds a Mouse + m.addAnimal(new Mouse(m.getStart())); - // adds a Monkey - m.addAnimal(new Monkey(m.getStart())); + // adds a Monkey + m.addAnimal(new Monkey(m.getStart())); - // adds a Hamster - m.addAnimal(new Hamster(m.getStart())); + // adds a Hamster + m.addAnimal(new Hamster(m.getStart())); - // adds a Bear (if this bonus is coded) - //m.addAnimal(new Bear(m.getStart())); + // adds a Bear (if this bonus is coded) + //m.addAnimal(new Bear(m.getStart())); - // adds a Panda - m.addAnimal(new Panda(m.getStart())); + // adds a Panda + m.addAnimal(new Panda(m.getStart())); - return simulation; - } + return simulation; + } - /** - * Creates a {@code DaedalusSimulation} with every ghost implementation and - * 3 Pac-Mans. - * - * @return A {@code DaedalusSimulation} to display - */ + /** + * Creates a {@code DaedalusSimulation} with every ghost implementation and + * 3 Pac-Mans. + * + * @return A {@code DaedalusSimulation} to display + */ - public static Simulation getDaedalusSimulation() { - int[][] labyrinth = LabyrinthGenerator.getPacMan(); - Daedalus d = new Daedalus(labyrinth); - Simulation simulation = new DaedalusSimulation(d); + public static Simulation getDaedalusSimulation() { + int[][] labyrinth = LabyrinthGenerator.getPacMan(); + Daedalus d = new Daedalus(labyrinth); + Simulation simulation = new DaedalusSimulation(d); - // adds Pac-Mans - d.addPrey(new PacMan(new Vector2D(9, 15))); - d.addPrey(new PacMan(new Vector2D(10, 15))); - d.addPrey(new PacMan(new Vector2D(8, 15))); + // adds Pac-Mans + d.addPrey(new PacMan(new Vector2D(9, 15))); + d.addPrey(new PacMan(new Vector2D(10, 15))); + d.addPrey(new PacMan(new Vector2D(8, 15))); - // adds Blinky - d.addPredator(new Blinky(new Vector2D(17, 1))); + // adds Blinky + d.addPredator(new Blinky(new Vector2D(17, 1))); - // adds Pinky - d.addPredator(new Pinky(new Vector2D(1, 1))); + // adds Pinky + d.addPredator(new Pinky(new Vector2D(1, 1))); - // adds Inky - d.addPredator(new Inky(new Vector2D(17, 17))); + // adds Inky + d.addPredator(new Inky(new Vector2D(17, 17))); - // adds Clyde - d.addPredator(new Clyde(new Vector2D(1, 17))); + // adds Clyde + d.addPredator(new Clyde(new Vector2D(1, 17))); - return simulation; - } + return simulation; + } } -- cgit v1.2.3