aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/api/utils/Dimension.java
blob: 69958b16a89955f0444d83a91dcd5bd7ef2a4aeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package dev.isxander.yacl.api.utils;

import dev.isxander.yacl.impl.utils.DimensionIntegerImpl;

public interface Dimension<T extends Number> {
    T x();
    T y();

    T width();
    T height();

    T xLimit();
    T yLimit();

    T centerX();
    T centerY();

    boolean isPointInside(T x, T y);

    Dimension<T> clone();

    Dimension<T> setX(T x);
    Dimension<T> setY(T y);
    Dimension<T> setWidth(T width);
    Dimension<T> setHeight(T height);

    Dimension<T> withX(T x);
    Dimension<T> withY(T y);
    Dimension<T> withWidth(T width);
    Dimension<T> withHeight(T height);

    Dimension<T> move(T x, T y);
    Dimension<T> expand(T width, T height);

    Dimension<T> moved(T x, T y);
    Dimension<T> expanded(T width, T height);

    static Dimension<Integer> ofInt(int x, int y, int width, int height) {
        return new DimensionIntegerImpl(x, y, width, height);
    }
}