20 lines
648 B
Java
Raw Normal View History

2023-12-02 20:06:46 +04:00
public class ObjectParameters {
private final int _x;
private final int _y;
private final int _width;
private final int _height;
public int getLeftBorder() {return _x;}
public int getTopBorder() {return _y;}
public int getRightBorder() {return _x + _width;}
public int getDownBorder() {return _y + _height;}
public int getObjectMiddleHorizontal() {return _x + this._width / 2;}
public int getObjectMiddleVertical() {return _y + this._height / 2;}
public ObjectParameters(int x, int y, int width, int height)
{
_x = x;
_y = y;
_width = width;
_height = height;
}
}