diff --git a/src/break_out/model/ILevel.java b/src/break_out/model/ILevel.java index af8777e..d3e55b5 100644 --- a/src/break_out/model/ILevel.java +++ b/src/break_out/model/ILevel.java @@ -3,6 +3,11 @@ package break_out.model; public interface ILevel { // Exercise 1 public Ball getBall(); + + // Exercise 2 public Paddle getPaddleTop(); public Paddle getPaddleBottom(); + + // Exercise 3 + public void setFinished(boolean finished); } \ No newline at end of file diff --git a/src/break_out/model/IPaddle.java b/src/break_out/model/IPaddle.java index f3a7e1d..4aef1ae 100644 --- a/src/break_out/model/IPaddle.java +++ b/src/break_out/model/IPaddle.java @@ -9,9 +9,13 @@ public interface IPaddle { public void setPosition(Position position); public Color getColor(); public void setColor(Color color); - public double getWidth(); - public void setWidth(double width); - public double getHeight(); - public void setHeight(double height); + public int getWidth(); + public void setWidth(int width); + public int getHeight(); + public void setHeight(int height); + // Exercise 3 + public int getDirection(); + public void setDirection(int direction); + public void updatePosition(Ball ball); } \ No newline at end of file diff --git a/src/break_out/model/Level.java b/src/break_out/model/Level.java index 36aa2ae..36229c9 100644 --- a/src/break_out/model/Level.java +++ b/src/break_out/model/Level.java @@ -177,6 +177,14 @@ public class Level extends Thread implements ILevel { return paddleBottom; } + /** + * The setter for the levels game state + * @param finished game state + */ + public void setFinished(boolean finished) { + + } + } diff --git a/src/break_out/model/Paddle.java b/src/break_out/model/Paddle.java index ce05e14..f40b711 100644 --- a/src/break_out/model/Paddle.java +++ b/src/break_out/model/Paddle.java @@ -19,8 +19,8 @@ public class Paddle implements IPaddle { /** * The paddles sizing */ - private double width; - private double height; + private int width; + private int height; /** * The paddles color @@ -84,7 +84,7 @@ public class Paddle implements IPaddle { * * @return width The paddles current width */ - public double getWidth() { + public int getWidth() { return width; } @@ -93,7 +93,7 @@ public class Paddle implements IPaddle { * * @param width The paddles new width */ - public void setWidth(double width) { + public void setWidth(int width) { this.width = width; } @@ -102,7 +102,7 @@ public class Paddle implements IPaddle { * * @return height The paddles current height */ - public double getHeight() { + public int getHeight() { return height; } @@ -111,7 +111,34 @@ public class Paddle implements IPaddle { * * @param height The paddles new height */ - public void setHeight(double height) { + public void setHeight(int height) { this.height = height; } + + /** + * The getter for the paddles direction + * + * @return direction The paddles current direction + */ + public int getDirection() { + return 0; + } + + /** + * The setter for the paddles direction + * + * @param direction The paddles new direction + */ + public void setDirection(int direction) { + + } + + /** + * Updates paddles position based on balls position + * + * @param ball The ball + */ + public void updatePosition(Ball ball) { + + } }