aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/fr/umlv
diff options
context:
space:
mode:
authorAdam NAILI2018-01-14 20:33:17 +0100
committerAdam NAILI2018-01-14 20:33:17 +0100
commit66ca4c453a6dc67e3b09ef3365c3b4805c44910d (patch)
treebf49b70239ba15e427e87bda4593b3ea0a217f07 /src/main/java/fr/umlv
parent1d07ffaa79712e22159ce4adb38a1c902915980e (diff)
downloadwallj-66ca4c453a6dc67e3b09ef3365c3b4805c44910d.tar.gz
Implementing Display controllers (and changing null in some Physics controllers to test the displays)
Diffstat (limited to 'src/main/java/fr/umlv')
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java14
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java3
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java9
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java9
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java3
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java9
-rw-r--r--src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java2
7 files changed, 38 insertions, 11 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java
index aa652a8..86a857f 100644
--- a/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java
+++ b/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java
@@ -1,9 +1,14 @@
1package fr.umlv.java.wallj.controller; 1package fr.umlv.java.wallj.controller;
2 2
3import fr.umlv.java.wallj.board.TileVec2;
3import fr.umlv.java.wallj.context.Context; 4import fr.umlv.java.wallj.context.Context;
5import fr.umlv.java.wallj.context.GraphicsContext;
4import fr.umlv.java.wallj.event.Event; 6import fr.umlv.java.wallj.event.Event;
5import fr.umlv.java.wallj.model.BombBlock; 7import fr.umlv.java.wallj.model.BombBlock;
8import org.jbox2d.common.Vec2;
6 9
10import java.awt.*;
11import java.util.Collections;
7import java.util.List; 12import java.util.List;
8import java.util.Objects; 13import java.util.Objects;
9 14
@@ -18,8 +23,13 @@ public class BombDisplayController extends DisplayController {
18 23
19 @Override 24 @Override
20 public List<Event> update(Context context) { 25 public List<Event> update(Context context) {
21 //TODO 26 GraphicsContext graphicsContext = context.getGraphicsContext();
22 return null; 27 graphicsContext.paintCircle(Color.BLACK, bomb.getPos(), TileVec2.TILE_DIM);
28 Vec2 textPosition = bomb.getPos();
29 textPosition.x += TileVec2.TILE_DIM / 4.0f;
30 textPosition.y += 3 * TileVec2.TILE_DIM / 4.0f;
31 graphicsContext.paintString(Color.RED, textPosition, Integer.toString(bomb.getTimer()));
32 return Collections.emptyList();
23 } 33 }
24 34
25} 35}
diff --git a/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java
index 45a3626..ed7e520 100644
--- a/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java
+++ b/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java
@@ -4,6 +4,7 @@ import fr.umlv.java.wallj.context.Context;
4import fr.umlv.java.wallj.event.Event; 4import fr.umlv.java.wallj.event.Event;
5import fr.umlv.java.wallj.model.BombBlock; 5import fr.umlv.java.wallj.model.BombBlock;
6 6
7import java.util.Collections;
7import java.util.List; 8import java.util.List;
8import java.util.Objects; 9import java.util.Objects;
9 10
@@ -19,7 +20,7 @@ public class BombPhysicsController extends PhysicsController {
19 @Override 20 @Override
20 public List<Event> update(Context context) { 21 public List<Event> update(Context context) {
21 //TODO 22 //TODO
22 return null; 23 return Collections.emptyList();
23 } 24 }
24 25
25} 26}
diff --git a/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java
index e878fb2..e5e53ab 100644
--- a/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java
+++ b/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java
@@ -1,9 +1,13 @@
1package fr.umlv.java.wallj.controller; 1package fr.umlv.java.wallj.controller;
2 2
3import fr.umlv.java.wallj.board.TileVec2;
3import fr.umlv.java.wallj.context.Context; 4import fr.umlv.java.wallj.context.Context;
5import fr.umlv.java.wallj.context.GraphicsContext;
4import fr.umlv.java.wallj.event.Event; 6import fr.umlv.java.wallj.event.Event;
5import fr.umlv.java.wallj.model.GarbageBlock; 7import fr.umlv.java.wallj.model.GarbageBlock;
6 8
9import java.awt.*;
10import java.util.Collections;
7import java.util.List; 11import java.util.List;
8import java.util.Objects; 12import java.util.Objects;
9 13
@@ -18,8 +22,9 @@ public class GarbageDisplayController extends DisplayController {
18 22
19 @Override 23 @Override
20 public List<Event> update(Context context) { 24 public List<Event> update(Context context) {
21 //TODO 25 GraphicsContext graphicsContext = context.getGraphicsContext();
22 return null; 26 graphicsContext.paintCircle(new Color(102, 51, 0), garbage.getPos(),TileVec2.TILE_DIM);
27 return Collections.emptyList();
23 } 28 }
24 29
25} 30}
diff --git a/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java
index 96ba68c..de3c4c4 100644
--- a/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java
+++ b/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java
@@ -1,9 +1,13 @@
1package fr.umlv.java.wallj.controller; 1package fr.umlv.java.wallj.controller;
2 2
3import fr.umlv.java.wallj.board.TileVec2;
3import fr.umlv.java.wallj.context.Context; 4import fr.umlv.java.wallj.context.Context;
5import fr.umlv.java.wallj.context.GraphicsContext;
4import fr.umlv.java.wallj.event.Event; 6import fr.umlv.java.wallj.event.Event;
5import fr.umlv.java.wallj.model.RobotBlock; 7import fr.umlv.java.wallj.model.RobotBlock;
6 8
9import java.awt.*;
10import java.util.Collections;
7import java.util.List; 11import java.util.List;
8import java.util.Objects; 12import java.util.Objects;
9 13
@@ -18,8 +22,9 @@ public class RobotDisplayController extends DisplayController {
18 22
19 @Override 23 @Override
20 public List<Event> update(Context context) { 24 public List<Event> update(Context context) {
21 //TODO 25 GraphicsContext graphicsContext = context.getGraphicsContext();
22 return null; 26 graphicsContext.paintCircle(Color.BLUE,robot.getPos(),TileVec2.TILE_DIM/2);
27 return Collections.emptyList();
23 } 28 }
24 29
25} 30}
diff --git a/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java
index f320480..57d098c 100644
--- a/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java
+++ b/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java
@@ -4,6 +4,7 @@ import fr.umlv.java.wallj.context.Context;
4import fr.umlv.java.wallj.event.Event; 4import fr.umlv.java.wallj.event.Event;
5import fr.umlv.java.wallj.model.RobotBlock; 5import fr.umlv.java.wallj.model.RobotBlock;
6 6
7import java.util.Collections;
7import java.util.List; 8import java.util.List;
8import java.util.Objects; 9import java.util.Objects;
9 10
@@ -19,7 +20,7 @@ public class RobotPhysicsController extends PhysicsController {
19 @Override 20 @Override
20 public List<Event> update(Context context) { 21 public List<Event> update(Context context) {
21 //TODO 22 //TODO
22 return null; 23 return Collections.emptyList();
23 } 24 }
24 25
25} 26}
diff --git a/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java
index dfba9be..523528b 100644
--- a/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java
+++ b/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java
@@ -1,9 +1,13 @@
1package fr.umlv.java.wallj.controller; 1package fr.umlv.java.wallj.controller;
2 2
3import fr.umlv.java.wallj.board.TileVec2;
3import fr.umlv.java.wallj.context.Context; 4import fr.umlv.java.wallj.context.Context;
5import fr.umlv.java.wallj.context.GraphicsContext;
4import fr.umlv.java.wallj.event.Event; 6import fr.umlv.java.wallj.event.Event;
5import fr.umlv.java.wallj.model.TrashBlock; 7import fr.umlv.java.wallj.model.TrashBlock;
6 8
9import java.awt.*;
10import java.util.Collections;
7import java.util.List; 11import java.util.List;
8import java.util.Objects; 12import java.util.Objects;
9 13
@@ -18,8 +22,9 @@ public class TrashDisplayController extends DisplayController {
18 22
19 @Override 23 @Override
20 public List<Event> update(Context context) { 24 public List<Event> update(Context context) {
21 //TODO 25 GraphicsContext graphicsContext = context.getGraphicsContext();
22 return null; 26 graphicsContext.paintRectangle(Color.RED,trash.getPos(), TileVec2.TILE_DIM,TileVec2.TILE_DIM);
27 return Collections.emptyList();
23 } 28 }
24 29
25} 30}
diff --git a/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java
index 7b7011c..428f83c 100644
--- a/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java
+++ b/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java