aboutsummaryrefslogtreecommitdiff
path: root/src/client/java/dev/isxander/yacl/api/Controller.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/java/dev/isxander/yacl/api/Controller.java')
-rw-r--r--src/client/java/dev/isxander/yacl/api/Controller.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/client/java/dev/isxander/yacl/api/Controller.java b/src/client/java/dev/isxander/yacl/api/Controller.java
new file mode 100644
index 0000000..7bf7e7f
--- /dev/null
+++ b/src/client/java/dev/isxander/yacl/api/Controller.java
@@ -0,0 +1,28 @@
+package dev.isxander.yacl.api;
+
+import dev.isxander.yacl.api.utils.Dimension;
+import dev.isxander.yacl.gui.AbstractWidget;
+import dev.isxander.yacl.gui.YACLScreen;
+import net.minecraft.text.Text;
+
+/**
+ * Provides a widget to control the option.
+ */
+public interface Controller<T> {
+ /**
+ * Gets the dedicated {@link Option} for this controller
+ */
+ Option<T> option();
+
+ /**
+ * Gets the formatted value based on {@link Option#pendingValue()}
+ */
+ Text formatValue();
+
+ /**
+ * Provides a widget to display
+ *
+ * @param screen parent screen
+ */
+ AbstractWidget provideWidget(YACLScreen screen, Dimension<Integer> widgetDimension);
+}