aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/dev/isxander/yacl/api/utils/Dimension.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/dev/isxander/yacl/api/utils/Dimension.java')
-rw-r--r--src/main/java/dev/isxander/yacl/api/utils/Dimension.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/dev/isxander/yacl/api/utils/Dimension.java b/src/main/java/dev/isxander/yacl/api/utils/Dimension.java
new file mode 100644
index 0000000..cf7127a
--- /dev/null
+++ b/src/main/java/dev/isxander/yacl/api/utils/Dimension.java
@@ -0,0 +1,20 @@
+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();
+
+ boolean isPointInside(T x, T y);
+
+ static Dimension<Integer> ofInt(int x, int y, int width, int height) {
+ return new DimensionIntegerImpl(x, y, width, height);
+ }
+}