116 lines
1.9 KiB
Java
116 lines
1.9 KiB
Java
package break_out.model;
|
|
|
|
import break_out.Constants;
|
|
|
|
import java.awt.*;
|
|
|
|
/**
|
|
* This class contains the information about the paddles characteristics and behavior
|
|
*
|
|
* @author Gruppe 175: Moritz Henseleit, Ruben Meyer
|
|
*/
|
|
public class Paddle implements IPaddle {
|
|
|
|
/**
|
|
* The paddles position on the playground
|
|
*/
|
|
private Position position;
|
|
|
|
/**
|
|
* The paddles sizing
|
|
*/
|
|
private double width;
|
|
private double height;
|
|
|
|
/**
|
|
* The paddles color
|
|
*/
|
|
private Color color;
|
|
|
|
/**
|
|
* The constructor of a paddle
|
|
*/
|
|
public Paddle(Position position) {
|
|
this.position = position;
|
|
|
|
// set sizing
|
|
width = Constants.PADDLE_WIDTH;
|
|
height = Constants.PADDLE_HEIGHT;
|
|
|
|
// set color
|
|
color = Color.CYAN;
|
|
}
|
|
|
|
/**
|
|
* The getter for the paddles position
|
|
*
|
|
* @return position The paddles current position
|
|
*/
|
|
public Position getPosition() {
|
|
return position;
|
|
}
|
|
|
|
/**
|
|
* The setter for the paddles position
|
|
*
|
|
* @param position The paddles new position
|
|
*/
|
|
public void setPosition(Position position) {
|
|
this.position = position;
|
|
}
|
|
|
|
/**
|
|
* The getter for the paddles color
|
|
*
|
|
* @return color The paddles current color
|
|
*/
|
|
public Color getColor() {
|
|
return color;
|
|
}
|
|
|
|
/**
|
|
* The setter for the paddles color
|
|
*
|
|
* @param color The paddles new color
|
|
*/
|
|
public void setColor(Color color) {
|
|
this.color = color;
|
|
}
|
|
|
|
/**
|
|
* The getter for the paddles width
|
|
*
|
|
* @return width The paddles current width
|
|
*/
|
|
public double getWidth() {
|
|
return width;
|
|
}
|
|
|
|
/**
|
|
* The setter for the paddles width
|
|
*
|
|
* @param width The paddles new width
|
|
*/
|
|
public void setWidth(double width) {
|
|
this.width = width;
|
|
}
|
|
|
|
/**
|
|
* The getter for the paddles height
|
|
*
|
|
* @return height The paddles current height
|
|
*/
|
|
public double getHeight() {
|
|
return height;
|
|
}
|
|
|
|
/**
|
|
* The setter for the paddles height
|
|
*
|
|
* @param height The paddles new height
|
|
*/
|
|
public void setHeight(double height) {
|
|
this.height = height;
|
|
}
|
|
}
|