From f28560be9aceaf407613834a8fade1bfeedda449 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 29 Feb 2016 15:34:45 +0100 Subject: Reformat code --- src/ch/epfl/xblast/Lists.java | 8 +++++--- src/ch/epfl/xblast/server/Block.java | 1 + src/ch/epfl/xblast/server/Board.java | 26 ++++++++++++++------------ src/ch/epfl/xblast/server/Ticks.java | 2 ++ 4 files changed, 22 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/ch/epfl/xblast/Lists.java b/src/ch/epfl/xblast/Lists.java index 096ceba..aadc694 100644 --- a/src/ch/epfl/xblast/Lists.java +++ b/src/ch/epfl/xblast/Lists.java @@ -1,20 +1,21 @@ package ch.epfl.xblast; -import java.util.List; import java.util.ArrayList; import java.util.Collections; +import java.util.List; /** * @author Pacien TRAN-GIRARD (261948) * @author Timothée FLOURE (257420) */ public final class Lists { + /** * Return a sysmetric version of the list. * * @param l the input list - * @throws IllegalArgumentException if the given list is empty * @return mirroredList the mirrored ilist + * @throws IllegalArgumentException if the given list is empty */ public static List mirrored(List l) { if (l.size() == 0) { @@ -24,7 +25,7 @@ public final class Lists { List mirroredList = new ArrayList(); List rightSide = new ArrayList(); - for (int i=0;i < l.size()-1;i++) { + for (int i = 0; i < l.size() - 1; i++) { rightSide.add(l.get(i)); } @@ -35,4 +36,5 @@ public final class Lists { return mirroredList; } + } diff --git a/src/ch/epfl/xblast/server/Block.java b/src/ch/epfl/xblast/server/Block.java index d1c96e5..409f68e 100644 --- a/src/ch/epfl/xblast/server/Block.java +++ b/src/ch/epfl/xblast/server/Block.java @@ -54,4 +54,5 @@ public enum Block { public boolean castsShadow() { return this == INDESTRUCTIBLE_WALL || this == DESTRUCTIBLE_WALL || this == CRUMBLING_WALL; } + } diff --git a/src/ch/epfl/xblast/server/Board.java b/src/ch/epfl/xblast/server/Board.java index b385ed8..62cfd0a 100644 --- a/src/ch/epfl/xblast/server/Board.java +++ b/src/ch/epfl/xblast/server/Board.java @@ -1,18 +1,19 @@ package ch.epfl.xblast.server; -import java.util.List; -import java.util.ArrayList; import ch.epfl.cs108.Sq; import ch.epfl.xblast.Lists; +import java.util.ArrayList; +import java.util.List; + /** * A two-dimensional Board in which the game takes place. * * @author Pacien TRAN-GIRARD (261948) * @author Timothée FLOURE (257420) */ - public final class Board { + /** * List containing all the blocks of the board. */ @@ -21,10 +22,10 @@ public final class Board { /** * Instanciates a new Board with the given sequence of blocks. * - * @throws IllegalArgumentException if the blocks is not composed of 195 elements * @param blocks sequence containing all the blocks of the Boards + * @throws IllegalArgumentException if the blocks is not composed of 195 elements */ - public Board (List> blocks) { + public Board(List> blocks) { if (blocks.size() != 195) { throw new IllegalArgumentException(); } @@ -35,8 +36,8 @@ public final class Board { * Build a new Board with the given Matrix. * * @param rows list containing all the rows - * @throws IllegalArgumentException if rows is not 13*15 * @return a new Board built with given rows + * @throws IllegalArgumentException if rows is not 13*15 */ public static Board ofRows(List> rows) { if (rows.size() != 13) { @@ -60,11 +61,11 @@ public final class Board { } /** - * Build a walled board filled with the given inner rows + * Build a walled board filled with the given inner rows * * @param innerBlocks lists of the internal rows - * @throws IllegalArgumentException if innerbLocks is not 11*13 * @return a new walled board filled with the given rows + * @throws IllegalArgumentException if innerbLocks is not 11*13 */ public static Board ofInnerBlocksWalled(List> innerBlocks) { if (innerBlocks.size() != 11) { @@ -74,7 +75,7 @@ public final class Board { List> rowsList = new ArrayList<>(); List wallLine = new ArrayList<>(); - for (int i = 0; i < 15;i++) { + for (int i = 0; i < 15; i++) { wallLine.add(Block.INDESTRUCTIBLE_WALL); } @@ -84,13 +85,13 @@ public final class Board { } List row = innerBlocks.get(i); - row.add(0,Block.INDESTRUCTIBLE_WALL); + row.add(0, Block.INDESTRUCTIBLE_WALL); row.add(Block.INDESTRUCTIBLE_WALL); rowsList.add(row); } - rowsList.add(0,wallLine); + rowsList.add(0, wallLine); rowsList.add(wallLine); return ofRows(rowsList); @@ -100,8 +101,8 @@ public final class Board { * Build a symmetric walled board from the NWB quadrant. * * @param quadrantNWBlocks the NW quadrant of the board (inner blocks only!) - * @throws IllegalArgumentException if quadrantNWBlocks is not 6*7 * @return a new walled board symmetrically filled with the given NW quadrant + * @throws IllegalArgumentException if quadrantNWBlocks is not 6*7 */ public static Board ofQuadrantNWBlocksWalled(List> quadrantNWBlocks) { if (quadrantNWBlocks.size() != 6) { @@ -121,4 +122,5 @@ public final class Board { } return ofInnerBlocksWalled(rowsList); } + } diff --git a/src/ch/epfl/xblast/server/Ticks.java b/src/ch/epfl/xblast/server/Ticks.java index 0992876..cdccad8 100644 --- a/src/ch/epfl/xblast/server/Ticks.java +++ b/src/ch/epfl/xblast/server/Ticks.java @@ -7,6 +7,7 @@ package ch.epfl.xblast.server; * @author Timothée FLOURE (257420) */ public interface Ticks { + /** * Duration of the death of a player (in ticks). */ @@ -36,4 +37,5 @@ public interface Ticks { * Duration of the presence of a bonus (in ticks). */ public static int BONUS_DISAPPEARING_TICKS = EXPLOSION_TICKS; + } -- cgit v1.2.3