diff --git a/src/main/java/Snake/SnakeView.java b/src/main/java/Snake/SnakeView.java index 847cff4..89c10aa 100644 --- a/src/main/java/Snake/SnakeView.java +++ b/src/main/java/Snake/SnakeView.java @@ -15,6 +15,16 @@ public class SnakeView implements Drawable{ this.cellSize = cellSize; } + public void setPositions(ArrayList newPositions) + { + positions.clear(); + for(var newPosition : newPositions) + { + Point positionInGrid = newPosition; + positions.add(new Point((int)positionInGrid.getX()*cellSize, + (int)positionInGrid.getY()*cellSize)); + } + } @Override public void draw(Graphics g) { diff --git a/target/classes/Snake/SnakeView.class b/target/classes/Snake/SnakeView.class index 7921841..4d43df8 100644 Binary files a/target/classes/Snake/SnakeView.class and b/target/classes/Snake/SnakeView.class differ