package starter.game.v0;

public class Rectangle {
    private Point origin;
    private int width;
    private int height;

    public Rectangle() {
    }

    public Rectangle(Point origin, int width, int height) {
        this.origin = origin;
        this.width = width;
        this.height = height;
    }

    public boolean include(Point location) {
        return origin.getX() <= location.getX()
            && location.getX() <= origin.getX() + width
            && origin.getY() <= location.getY()
            && location.getY() <= origin.getY() + height;
    }

    public Point getOrigin() {
        return origin;
    }

    public void setOrigin(Point origin) {
        this.origin = origin;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
}
