diff options
-rw-r--r-- | src/ch/epfl/xblast/server/Board.java | 4 | ||||
-rw-r--r-- | src/ch/epfl/xblast/server/Ticks.java | 12 | ||||
-rw-r--r-- | test/ch/epfl/xblast/server/BoardTest.java | 34 |
3 files changed, 25 insertions, 25 deletions
diff --git a/src/ch/epfl/xblast/server/Board.java b/src/ch/epfl/xblast/server/Board.java index 62cfd0a..5e899f6 100644 --- a/src/ch/epfl/xblast/server/Board.java +++ b/src/ch/epfl/xblast/server/Board.java | |||
@@ -111,14 +111,14 @@ public final class Board { | |||
111 | 111 | ||
112 | List<List<Block>> rowsList = new ArrayList<>(); | 112 | List<List<Block>> rowsList = new ArrayList<>(); |
113 | 113 | ||
114 | List<List<Block>> halfInnerBoard = Lists.<List<Block>>mirrored(quadrantNWBlocks); | 114 | List<List<Block>> halfInnerBoard = Lists.mirrored(quadrantNWBlocks); |
115 | 115 | ||
116 | for (int i = 0; i < halfInnerBoard.size(); i++) { | 116 | for (int i = 0; i < halfInnerBoard.size(); i++) { |
117 | if (halfInnerBoard.get(i).size() != 7) { | 117 | if (halfInnerBoard.get(i).size() != 7) { |
118 | throw new IllegalArgumentException(); | 118 | throw new IllegalArgumentException(); |
119 | } | 119 | } |
120 | 120 | ||
121 | rowsList.add(Lists.<Block>mirrored(halfInnerBoard.get(i))); | 121 | rowsList.add(Lists.mirrored(halfInnerBoard.get(i))); |
122 | } | 122 | } |
123 | return ofInnerBlocksWalled(rowsList); | 123 | return ofInnerBlocksWalled(rowsList); |
124 | } | 124 | } |
diff --git a/src/ch/epfl/xblast/server/Ticks.java b/src/ch/epfl/xblast/server/Ticks.java index c19f073..aa08a23 100644 --- a/src/ch/epfl/xblast/server/Ticks.java +++ b/src/ch/epfl/xblast/server/Ticks.java | |||
@@ -11,31 +11,31 @@ public interface Ticks { | |||
11 | /** | 11 | /** |
12 | * Duration of the death of a player (in ticks). | 12 | * Duration of the death of a player (in ticks). |
13 | */ | 13 | */ |
14 | public static int PLAYER_DYING_TICKS = 8; | 14 | int PLAYER_DYING_TICKS = 8; |
15 | 15 | ||
16 | /** | 16 | /** |
17 | * Duration of the invulnerability of a player (in ticks). | 17 | * Duration of the invulnerability of a player (in ticks). |
18 | */ | 18 | */ |
19 | public static int PLAYER_INVULNERABLE_TICKS = 64; | 19 | int PLAYER_INVULNERABLE_TICKS = 64; |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * Duration of the timer of a bomb (in ticks). | 22 | * Duration of the timer of a bomb (in ticks). |
23 | */ | 23 | */ |
24 | public static int BOMB_FUSE_TICKS = 100; | 24 | int BOMB_FUSE_TICKS = 100; |
25 | 25 | ||
26 | /** | 26 | /** |
27 | * Duration of an explosion (in ticks). | 27 | * Duration of an explosion (in ticks). |
28 | */ | 28 | */ |
29 | public static int EXPLOSION_TICKS = 30; | 29 | int EXPLOSION_TICKS = 30; |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * Duration of crumbling of a wall (in ticks). | 32 | * Duration of crumbling of a wall (in ticks). |
33 | */ | 33 | */ |
34 | public static int WALL_CRUMBLING_TICKS = EXPLOSION_TICKS; | 34 | int WALL_CRUMBLING_TICKS = EXPLOSION_TICKS; |
35 | 35 | ||
36 | /** | 36 | /** |
37 | * Duration of the presence of a bonus (in ticks). | 37 | * Duration of the presence of a bonus (in ticks). |
38 | */ | 38 | */ |
39 | public static int BONUS_DISAPPEARING_TICKS = EXPLOSION_TICKS; | 39 | int BONUS_DISAPPEARING_TICKS = EXPLOSION_TICKS; |
40 | 40 | ||
41 | } | 41 | } |
diff --git a/test/ch/epfl/xblast/server/BoardTest.java b/test/ch/epfl/xblast/server/BoardTest.java index e40769b..673ab3b 100644 --- a/test/ch/epfl/xblast/server/BoardTest.java +++ b/test/ch/epfl/xblast/server/BoardTest.java | |||
@@ -14,14 +14,14 @@ import static org.junit.Assert.*; | |||
14 | public class BoardTest { | 14 | public class BoardTest { |
15 | @Test(expected=IllegalArgumentException.class) | 15 | @Test(expected=IllegalArgumentException.class) |
16 | public void isBoardBuilderEmptyInputThrowingException() { | 16 | public void isBoardBuilderEmptyInputThrowingException() { |
17 | List<Sq<Block>> blocks = new ArrayList<Sq<Block>>(); | 17 | List<Sq<Block>> blocks = new ArrayList<>(); |
18 | new Board(blocks); | 18 | new Board(blocks); |
19 | 19 | ||
20 | } | 20 | } |
21 | 21 | ||
22 | @Test(expected=IllegalArgumentException.class) | 22 | @Test(expected=IllegalArgumentException.class) |
23 | public void isBoardBuilderIllegalInputThrowingException() { | 23 | public void isBoardBuilderIllegalInputThrowingException() { |
24 | List<Sq<Block>> blocks = new ArrayList<Sq<Block>>(); | 24 | List<Sq<Block>> blocks = new ArrayList<>(); |
25 | 25 | ||
26 | for (int i = 0;i<8;i++) { | 26 | for (int i = 0;i<8;i++) { |
27 | blocks.add(Sq.constant(Block.FREE)); | 27 | blocks.add(Sq.constant(Block.FREE)); |
@@ -33,14 +33,14 @@ public class BoardTest { | |||
33 | 33 | ||
34 | @Test(expected=IllegalArgumentException.class) | 34 | @Test(expected=IllegalArgumentException.class) |
35 | public void isOfRowsEmptyInputMatrixThrowingException() { | 35 | public void isOfRowsEmptyInputMatrixThrowingException() { |
36 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 36 | List<List<Block>> rowsList = new ArrayList<>(); |
37 | Board.ofRows(rowsList); | 37 | Board.ofRows(rowsList); |
38 | } | 38 | } |
39 | 39 | ||
40 | @Test(expected=IllegalArgumentException.class) | 40 | @Test(expected=IllegalArgumentException.class) |
41 | public void isOfRowsIllegalInputThrowingException() { | 41 | public void isOfRowsIllegalInputThrowingException() { |
42 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 42 | List<List<Block>> rowsList = new ArrayList<>(); |
43 | List<Block> sampleRow = new ArrayList<Block>(); | 43 | List<Block> sampleRow = new ArrayList<>(); |
44 | 44 | ||
45 | for (int i = 0;i < 8 ;i++) { | 45 | for (int i = 0;i < 8 ;i++) { |
46 | sampleRow.add(Block.FREE); | 46 | sampleRow.add(Block.FREE); |
@@ -52,10 +52,10 @@ public class BoardTest { | |||
52 | 52 | ||
53 | @Test | 53 | @Test |
54 | public void buildBoardFromRowsMatrix() { | 54 | public void buildBoardFromRowsMatrix() { |
55 | List<List<Block>> rowsList = new ArrayList<List<Block>>() ; | 55 | List<List<Block>> rowsList = new ArrayList<>() ; |
56 | 56 | ||
57 | for (int i = 0; i < 13; i++) { | 57 | for (int i = 0; i < 13; i++) { |
58 | List<Block> sampleRow = new ArrayList<Block>(); | 58 | List<Block> sampleRow = new ArrayList<>(); |
59 | for (int j = 0; j < 15; j++) { | 59 | for (int j = 0; j < 15; j++) { |
60 | sampleRow.add(Block.FREE); | 60 | sampleRow.add(Block.FREE); |
61 | } | 61 | } |
@@ -67,14 +67,14 @@ public class BoardTest { | |||
67 | 67 | ||
68 | @Test(expected=IllegalArgumentException.class) | 68 | @Test(expected=IllegalArgumentException.class) |
69 | public void isOfInnerBlocksWalledEmptyInputMatrixThrowingException() { | 69 | public void isOfInnerBlocksWalledEmptyInputMatrixThrowingException() { |
70 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 70 | List<List<Block>> rowsList = new ArrayList<>(); |
71 | Board.ofInnerBlocksWalled(rowsList); | 71 | Board.ofInnerBlocksWalled(rowsList); |
72 | } | 72 | } |
73 | 73 | ||
74 | @Test(expected=IllegalArgumentException.class) | 74 | @Test(expected=IllegalArgumentException.class) |
75 | public void isOfInnerBlocksWalledIllegalInputThrowingException() { | 75 | public void isOfInnerBlocksWalledIllegalInputThrowingException() { |
76 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 76 | List<List<Block>> rowsList = new ArrayList<>(); |
77 | List<Block> sampleRow = new ArrayList<Block>(); | 77 | List<Block> sampleRow = new ArrayList<>(); |
78 | 78 | ||
79 | for (int i = 0;i < 8 ;i++) { | 79 | for (int i = 0;i < 8 ;i++) { |
80 | sampleRow.add(Block.FREE); | 80 | sampleRow.add(Block.FREE); |
@@ -86,10 +86,10 @@ public class BoardTest { | |||
86 | 86 | ||
87 | @Test | 87 | @Test |
88 | public void buildBoardFromInnerBlocks() { | 88 | public void buildBoardFromInnerBlocks() { |
89 | List<List<Block>> rowsList = new ArrayList<List<Block>>() ; | 89 | List<List<Block>> rowsList = new ArrayList<>() ; |
90 | 90 | ||
91 | for (int i = 0; i < 11; i++) { | 91 | for (int i = 0; i < 11; i++) { |
92 | List<Block> sampleRow = new ArrayList<Block>(); | 92 | List<Block> sampleRow = new ArrayList<>(); |
93 | for (int j = 0; j < 13; j++) { | 93 | for (int j = 0; j < 13; j++) { |
94 | sampleRow.add(Block.FREE); | 94 | sampleRow.add(Block.FREE); |
95 | } | 95 | } |
@@ -101,14 +101,14 @@ public class BoardTest { | |||
101 | 101 | ||
102 | @Test(expected=IllegalArgumentException.class) | 102 | @Test(expected=IllegalArgumentException.class) |
103 | public void isBuildWithEmptyQuadrantThrowingException() { | 103 | public void isBuildWithEmptyQuadrantThrowingException() { |
104 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 104 | List<List<Block>> rowsList = new ArrayList<>(); |
105 | Board.ofQuadrantNWBlocksWalled(rowsList); | 105 | Board.ofQuadrantNWBlocksWalled(rowsList); |
106 | } | 106 | } |
107 | 107 | ||
108 | @Test(expected=IllegalArgumentException.class) | 108 | @Test(expected=IllegalArgumentException.class) |
109 | public void isBuildWithIllegalQuadrantThrowingException() { | 109 | public void isBuildWithIllegalQuadrantThrowingException() { |
110 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 110 | List<List<Block>> rowsList = new ArrayList<>(); |
111 | List<Block> sampleRow = new ArrayList<Block>(); | 111 | List<Block> sampleRow = new ArrayList<>(); |
112 | 112 | ||
113 | for (int i = 0;i < 8 ;i++) { | 113 | for (int i = 0;i < 8 ;i++) { |
114 | sampleRow.add(Block.FREE); | 114 | sampleRow.add(Block.FREE); |
@@ -120,10 +120,10 @@ public class BoardTest { | |||
120 | 120 | ||
121 | @Test | 121 | @Test |
122 | public void buildBoardFromNWQuadrant() { | 122 | public void buildBoardFromNWQuadrant() { |
123 | List<List<Block>> rowsList = new ArrayList<List<Block>>() ; | 123 | List<List<Block>> rowsList = new ArrayList<>() ; |
124 | 124 | ||
125 | for (int i = 0; i < 6; i++) { | 125 | for (int i = 0; i < 6; i++) { |
126 | List<Block> sampleRow = new ArrayList<Block>(); | 126 | List<Block> sampleRow = new ArrayList<>(); |
127 | for (int j = 0; j < 7; j++) { | 127 | for (int j = 0; j < 7; j++) { |
128 | sampleRow.add(Block.FREE); | 128 | sampleRow.add(Block.FREE); |
129 | } | 129 | } |