33 lines
690 B
Java
33 lines
690 B
Java
public class ObjectParameters {
|
|
private final int x;
|
|
private final int y;
|
|
private final int width;
|
|
private final int height;
|
|
public int leftBorder(){
|
|
return x;
|
|
}
|
|
public int topBorder(){
|
|
return y;
|
|
}
|
|
public int rightBorder(){
|
|
return x + width;
|
|
}
|
|
public int downBorder(){
|
|
return y + height;
|
|
}
|
|
public int objectMiddleHorizontal(){
|
|
return x+width/2;
|
|
}
|
|
public int objectMiddleVertical(){
|
|
return y + height/2;
|
|
}
|
|
|
|
public ObjectParameters(int x, int y, int width,int height){
|
|
this.x = x;
|
|
this.y = y;
|
|
this.width = width;
|
|
this.height = height;
|
|
}
|
|
}
|
|
|