aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/fr/umlv/java/wallj/board/Board.java136
-rw-r--r--src/main/java/fr/umlv/java/wallj/board/BoardConverter.java10
-rw-r--r--src/main/java/fr/umlv/java/wallj/board/BoardParser.java142
-rw-r--r--src/main/java/fr/umlv/java/wallj/board/BoardValidator.java10
-rw-r--r--src/main/java/fr/umlv/java/wallj/board/TileVec2.java166
-rw-r--r--src/main/java/fr/umlv/java/wallj/context/Context.java98
-rw-r--r--src/main/java/fr/umlv/java/wallj/context/Game.java130
-rw-r--r--src/main/java/fr/umlv/java/wallj/context/GraphicsContext.java124
-rw-r--r--src/main/java/fr/umlv/java/wallj/context/InputHandler.java120
-rw-r--r--src/main/java/fr/umlv/java/wallj/context/ScreenManager.java76
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/BlockController.java42
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/BlockControllerFactory.java98
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/Controller.java20
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/DisplayController.java24
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/GameController.java24
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/GarbagePhysicsController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/PhysicsController.java24
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/StageController.java24
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/TrashPhysicsController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/WallPhysicsController.java50
-rw-r--r--src/main/java/fr/umlv/java/wallj/event/AddBombEvent.java26
-rw-r--r--src/main/java/fr/umlv/java/wallj/event/ConfirmEvent.java10
-rw-r--r--src/main/java/fr/umlv/java/wallj/event/DropBombEvent.java10
-rw-r--r--src/main/java/fr/umlv/java/wallj/event/Event.java8
-rw-r--r--src/main/java/fr/umlv/java/wallj/event/MoveRobotEvent.java28
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/Block.java150
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/BlockFactory.java84
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/BlockType.java114
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/BombBlock.java62
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/GarbageBlock.java38
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/RobotBlock.java38
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/Stage.java10
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/TrashBlock.java38
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/WallBlock.java38
-rw-r--r--src/main/java/fr/umlv/java/wallj/utils/PathFinder.java10
-rw-r--r--src/main/java/fr/umlv/java/wallj/viewer/Viewer.java66
43 files changed, 1249 insertions, 1249 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/board/Board.java b/src/main/java/fr/umlv/java/wallj/board/Board.java
index c697cc2..a4ac421 100644
--- a/src/main/java/fr/umlv/java/wallj/board/Board.java
+++ b/src/main/java/fr/umlv/java/wallj/board/Board.java
@@ -1,68 +1,68 @@
1package fr.umlv.java.wallj.board; 1package fr.umlv.java.wallj.board;
2 2
3import fr.umlv.java.wallj.model.BlockType; 3import fr.umlv.java.wallj.model.BlockType;
4import fr.umlv.java.wallj.utils.Matrix; 4import fr.umlv.java.wallj.utils.Matrix;
5 5
6/** 6/**
7 * An immutable BlockType matrix. 7 * An immutable BlockType matrix.
8 * 8 *
9 * @author Pacien TRAN-GIRARD 9 * @author Pacien TRAN-GIRARD
10 */ 10 */
11public final class Board { 11public final class Board {
12 12
13 /** 13 /**
14 * Board Builder 14 * Board Builder
15 */ 15 */
16 public static final class Builder { 16 public static final class Builder {
17 private final BlockType[][] map; 17 private final BlockType[][] map;
18 18
19 /** 19 /**
20 * @param width width in tiles 20 * @param width width in tiles
21 * @param height height in tiles 21 * @param height height in tiles
22 */ 22 */
23 public Builder(int width, int height) { 23 public Builder(int width, int height) {
24 this.map = new BlockType[width][height]; 24 this.map = new BlockType[width][height];
25 } 25 }
26 26
27 /** 27 /**
28 * @param pos the tile position vector 28 * @param pos the tile position vector
29 * @param type the BlockType to set 29 * @param type the BlockType to set
30 * @return the Builder 30 * @return the Builder
31 */ 31 */
32 public Builder setBlockTypeAt(TileVec2 pos, BlockType type) { 32 public Builder setBlockTypeAt(TileVec2 pos, BlockType type) {
33 map[pos.getCol()][pos.getRow()] = type; 33 map[pos.getCol()][pos.getRow()] = type;
34 return this; 34 return this;
35 } 35 }
36 36
37 /** 37 /**
38 * @return the immutable Board 38 * @return the immutable Board
39 */ 39 */
40 public Board build() { 40 public Board build() {
41 return new Board(map); 41 return new Board(map);
42 } 42 }
43 } 43 }
44 44
45 private final BlockType[][] map; 45 private final BlockType[][] map;
46 46
47 private Board(BlockType[][] map) { 47 private Board(BlockType[][] map) {
48 int w = Matrix.getWidth(map), h = Matrix.getHeight(map); 48 int w = Matrix.getWidth(map), h = Matrix.getHeight(map);
49 this.map = new BlockType[h][w]; 49 this.map = new BlockType[h][w];
50 for (int row = 0; row < h; ++row) System.arraycopy(map[row], 0, this.map[row], 0, w); 50 for (int row = 0; row < h; ++row) System.arraycopy(map[row], 0, this.map[row], 0, w);
51 } 51 }
52 52
53 /** 53 /**
54 * @param pos the tile position vector 54 * @param pos the tile position vector
55 * @return the element at the given position 55 * @return the element at the given position
56 */ 56 */
57 public BlockType getBlockTypeAt(TileVec2 pos) { 57 public BlockType getBlockTypeAt(TileVec2 pos) {
58 return map[pos.getCol()][pos.getRow()]; 58 return map[pos.getCol()][pos.getRow()];
59 } 59 }
60 60
61 /** 61 /**
62 * @return the dimension of the Board 62 * @return the dimension of the Board
63 */ 63 */
64 public TileVec2 getDim() { 64 public TileVec2 getDim() {
65 return TileVec2.of(Matrix.getWidth(map), Matrix.getHeight(map)); 65 return TileVec2.of(Matrix.getWidth(map), Matrix.getHeight(map));
66 } 66 }
67 67
68} 68}
diff --git a/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java b/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java
index 4f67458..9f5736a 100644
--- a/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java
+++ b/src/main/java/fr/umlv/java/wallj/board/BoardConverter.java
@@ -1,5 +1,5 @@
1package fr.umlv.java.wallj.board; 1package fr.umlv.java.wallj.board;
2 2
3public class BoardConverter { 3public class BoardConverter {
4 //TODO 4 //TODO
5} 5}
diff --git a/src/main/java/fr/umlv/java/wallj/board/BoardParser.java b/src/main/java/fr/umlv/java/wallj/board/BoardParser.java
index 3d8386a..a9dca27 100644
--- a/src/main/java/fr/umlv/java/wallj/board/BoardParser.java
+++ b/src/main/java/fr/umlv/java/wallj/board/BoardParser.java
@@ -1,71 +1,71 @@
1package fr.umlv.java.wallj.board; 1package fr.umlv.java.wallj.board;
2 2
3import fr.umlv.java.wallj.model.BlockType; 3import fr.umlv.java.wallj.model.BlockType;
4import fr.umlv.java.wallj.utils.Matrix; 4import fr.umlv.java.wallj.utils.Matrix;
5 5
6import java.io.IOException; 6import java.io.IOException;
7import java.nio.file.Files; 7import java.nio.file.Files;
8import java.nio.file.Path; 8import java.nio.file.Path;
9import java.util.List; 9import java.util.List;
10import java.util.ListIterator; 10import java.util.ListIterator;
11import java.util.stream.Collectors; 11import java.util.stream.Collectors;
12 12
13/** 13/**
14 * Board deserializer. 14 * Board deserializer.
15 * 15 *
16 * @author Pacien TRAN-GIRARD