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/World.java | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
(limited to 'src/ch/epfl/maze/physical/World.java')
diff --git a/src/ch/epfl/maze/physical/World.java b/src/ch/epfl/maze/physical/World.java
index f13b2b1..9afbd5e 100644
--- a/src/ch/epfl/maze/physical/World.java
+++ b/src/ch/epfl/maze/physical/World.java
@@ -12,7 +12,6 @@ import java.util.List;
*
* @author Pacien TRAN-GIRARD
*/
-
public abstract class World {
/* tiles constants */
@@ -25,7 +24,6 @@ public abstract class World {
/**
* Structure of the labyrinth, an NxM array of tiles
*/
-
private final int[][] labyrinth;
private final Vector2D start;
@@ -36,7 +34,6 @@ public abstract class World {
*
* @param labyrinth Structure of the labyrinth, an NxM array of tiles
*/
-
public World(int[][] labyrinth) {
this.labyrinth = labyrinth;
@@ -50,7 +47,6 @@ public abstract class World {
* @param tileType Type of the tile
* @return A Vector2D of the first occurrence of the given tile type
*/
-
private Vector2D findFirstTileOfType(int tileType) {
for (int x = 0; x < this.getWidth(); ++x)
for (int y = 0; y < this.getHeight(); ++y)
@@ -65,13 +61,11 @@ public abstract class World {
*
* @return true if no more moves can be made, false otherwise
*/
-
abstract public boolean isSolved();
/**
* Resets the world as when it was instantiated.
*/
-
abstract public void reset();
/**
@@ -79,7 +73,6 @@ public abstract class World {
*
* @return A list of all animals in the world
*/
-
abstract public List getAnimals();
/**
@@ -90,7 +83,6 @@ public abstract class World {
* @return The tile number at position (x, y), or the NOTHING tile if x or y is
* incorrect.
*/
-
public final int getTile(int x, int y) {
if (x < 0 || x >= this.getWidth()) return World.NOTHING;
if (y < 0 || y >= this.getHeight()) return World.NOTHING;
@@ -104,7 +96,6 @@ public abstract class World {
* @param y Vertical coordinate
* @return true if an animal can walk on tile, false otherwise
*/
-
public final boolean isFree(int x, int y) {
int tile = this.getTile(x, y);
return !(tile == World.WALL || tile == World.NOTHING);
@@ -116,7 +107,6 @@ public abstract class World {
* @param position The position vector
* @return true if an animal can walk on tile, false otherwise
*/
-
public final boolean isFree(Vector2D position) {
return this.isFree(position.getX(), position.getY());
}
@@ -129,7 +119,6 @@ public abstract class World {
* @param position A position in the maze
* @return An array of all available choices at a position
*/
-
public final Direction[] getChoices(Vector2D position) {
List choices = new ArrayList<>();
for (Direction dir : Direction.POSSIBLE_DIRECTIONS)
@@ -144,7 +133,6 @@ public abstract class World {
*
* @return The horizontal length of the labyrinth
*/
-
public final int getWidth() {
return this.labyrinth[0].length;
}
@@ -154,7 +142,6 @@ public abstract class World {
*
* @return The vertical length of the labyrinth
*/
-
public final int getHeight() {
return this.labyrinth.length;
}
@@ -165,7 +152,6 @@ public abstract class World {
*
* @return Start position of the labyrinth, null if none.
*/
-
public final Vector2D getStart() {
return this.start;
}
@@ -175,8 +161,8 @@ public abstract class World {
*
* @return Exit position of the labyrinth, null if none.
*/
-
public final Vector2D getExit() {
return this.exit;
}
+
}
--
cgit v1.2.3