diff options
author | pacien | 2018-02-01 18:39:59 +0100 |
---|---|---|
committer | pacien | 2018-02-01 18:39:59 +0100 |
commit | 1a1d90fc6edc85fc3d6440db3a5d582a69a5441d (patch) | |
tree | 78cdf00e93f9d579bb32ffa1d714d13a87d3c228 | |
parent | cb05ab93e0ca27855a475f6c27a70ec869048f54 (diff) | |
download | wallj-1a1d90fc6edc85fc3d6440db3a5d582a69a5441d.tar.gz |
Use copy constructor for JBox vectors
Signed-off-by: pacien <pacien.trangirard@pacien.net>
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/block/JBoxBlock.java | 2 | ||||
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/block/RobotBlock.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/block/JBoxBlock.java b/src/main/java/fr/umlv/java/wallj/block/JBoxBlock.java index 48edbdc..06ecca3 100644 --- a/src/main/java/fr/umlv/java/wallj/block/JBoxBlock.java +++ b/src/main/java/fr/umlv/java/wallj/block/JBoxBlock.java | |||
@@ -23,7 +23,7 @@ public abstract class JBoxBlock extends Block { | |||
23 | @Override | 23 | @Override |
24 | public Vec2 getPos() { | 24 | public Vec2 getPos() { |
25 | if (body == null) throw new IllegalStateException("Uninitialised block."); | 25 | if (body == null) throw new IllegalStateException("Uninitialised block."); |
26 | return body.getPosition().clone(); | 26 | return new Vec2(body.getPosition()); |
27 | } | 27 | } |
28 | 28 | ||
29 | @Override | 29 | @Override |
diff --git a/src/main/java/fr/umlv/java/wallj/block/RobotBlock.java b/src/main/java/fr/umlv/java/wallj/block/RobotBlock.java index 065f367..45c75da 100644 --- a/src/main/java/fr/umlv/java/wallj/block/RobotBlock.java +++ b/src/main/java/fr/umlv/java/wallj/block/RobotBlock.java | |||
@@ -29,7 +29,7 @@ public class RobotBlock extends Block { | |||
29 | 29 | ||
30 | @Override | 30 | @Override |
31 | public Vec2 getPos() { | 31 | public Vec2 getPos() { |
32 | return pos.clone(); | 32 | return new Vec2(pos); |
33 | } | 33 | } |
34 | 34 | ||
35 | @Override | 35 | @Override |