1
0
Fork 0

BreakOut 3.* Vorgabe + Implementation

This commit is contained in:
rxbn_ 2019-12-17 18:10:30 +01:00
parent ce770c9cc7
commit 4fe42792ee
4 changed files with 54 additions and 10 deletions

View File

@ -3,6 +3,11 @@ package break_out.model;
public interface ILevel { public interface ILevel {
// Exercise 1 // Exercise 1
public Ball getBall(); public Ball getBall();
// Exercise 2
public Paddle getPaddleTop(); public Paddle getPaddleTop();
public Paddle getPaddleBottom(); public Paddle getPaddleBottom();
// Exercise 3
public void setFinished(boolean finished);
} }

View File

@ -9,9 +9,13 @@ public interface IPaddle {
public void setPosition(Position position); public void setPosition(Position position);
public Color getColor(); public Color getColor();
public void setColor(Color color); public void setColor(Color color);
public double getWidth(); public int getWidth();
public void setWidth(double width); public void setWidth(int width);
public double getHeight(); public int getHeight();
public void setHeight(double height); public void setHeight(int height);
// Exercise 3
public int getDirection();
public void setDirection(int direction);
public void updatePosition(Ball ball);
} }

View File

@ -177,6 +177,14 @@ public class Level extends Thread implements ILevel {
return paddleBottom; return paddleBottom;
} }
/**
* The setter for the levels game state
* @param finished game state
*/
public void setFinished(boolean finished) {
}
} }

View File

@ -19,8 +19,8 @@ public class Paddle implements IPaddle {
/** /**
* The paddles sizing * The paddles sizing
*/ */
private double width; private int width;
private double height; private int height;
/** /**
* The paddles color * The paddles color
@ -84,7 +84,7 @@ public class Paddle implements IPaddle {
* *
* @return width The paddles current width * @return width The paddles current width
*/ */
public double getWidth() { public int getWidth() {
return width; return width;
} }
@ -93,7 +93,7 @@ public class Paddle implements IPaddle {
* *
* @param width The paddles new width * @param width The paddles new width
*/ */
public void setWidth(double width) { public void setWidth(int width) {
this.width = width; this.width = width;
} }
@ -102,7 +102,7 @@ public class Paddle implements IPaddle {
* *
* @return height The paddles current height * @return height The paddles current height
*/ */
public double getHeight() { public int getHeight() {
return height; return height;
} }
@ -111,7 +111,34 @@ public class Paddle implements IPaddle {
* *
* @param height The paddles new height * @param height The paddles new height
*/ */
public void setHeight(double height) { public void setHeight(int height) {
this.height = 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) {
}
} }