ADD Position | ADD attribute 'position' to Tile

master
Mathis 2022-05-17 09:17:09 +02:00
parent a1f81b0d15
commit bc278df804
2 changed files with 30 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}