From bc278df80419ebbedaae95702406b0556400cd0d Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 17 May 2022 09:17:09 +0200 Subject: [PATCH] ADD Position | ADD attribute 'position' to Tile --- src/main/java/latice/model/Position.java | 21 +++++++++++++++++++++ src/main/java/latice/model/Tile.java | 9 +++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/main/java/latice/model/Position.java diff --git a/src/main/java/latice/model/Position.java b/src/main/java/latice/model/Position.java new file mode 100644 index 0000000..d92c44a --- /dev/null +++ b/src/main/java/latice/model/Position.java @@ -0,0 +1,21 @@ +package latice.model; + +public class Position { + private final Integer row; + private final Integer column; + + public Position(Integer row, Integer column) { + this.row = row; + this.column = column; + } + + public Integer getRow() { + return row; + } + + public Integer getColumn() { + return column; + } + + +} diff --git a/src/main/java/latice/model/Tile.java b/src/main/java/latice/model/Tile.java index b2ff117..5ded38a 100644 --- a/src/main/java/latice/model/Tile.java +++ b/src/main/java/latice/model/Tile.java @@ -3,12 +3,17 @@ package latice.model; public class Tile { private final Color color; private final Shape shape; + private Position position; public Tile(Color color, Shape shape) { this.color = color; this.shape = shape; } + public void setPosition(Position position) { + this.position = position; + } + public Color getColor() { return this.color; } @@ -16,4 +21,8 @@ public class Tile { public Shape getShape() { return this.shape; } + + public Position getPosition() { + return this.position; + } }