From a0dd0d5aca8f6203ca75c4189f9adad591ffe366 Mon Sep 17 00:00:00 2001 From: coolGi2007 Date: Thu, 3 Feb 2022 03:41:54 +0000 Subject: [PATCH] Added some stuff to get ready for the new config --- .../lod/core/config/ConfigAnnotations.java | 28 +++++++-- .../seibel/lod/core/config/ConfigEntry.java | 59 +++++++++++++++++++ 2 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/seibel/lod/core/config/ConfigEntry.java diff --git a/src/main/java/com/seibel/lod/core/config/ConfigAnnotations.java b/src/main/java/com/seibel/lod/core/config/ConfigAnnotations.java index dff0c9298..73c23d401 100644 --- a/src/main/java/com/seibel/lod/core/config/ConfigAnnotations.java +++ b/src/main/java/com/seibel/lod/core/config/ConfigAnnotations.java @@ -7,6 +7,7 @@ import java.lang.annotation.Target; /** * Where the annotations for the config are defined + * If there is no annotation then the config will not touch it * * @author coolGi2007 * @version 12-28-2021 @@ -19,6 +20,7 @@ public class ConfigAnnotations { { String name() default ""; + @Deprecated int width() default 150; double minValue() default Double.MIN_NORMAL; @@ -26,17 +28,14 @@ public class ConfigAnnotations { double maxValue() default Double.MAX_VALUE; } - + /** Makes text (looks like @Entry but dosnt save and has no button */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) - public @interface ScreenEntry + public @interface Category { String name() default ""; - - int width() default 100; } - /** Makes text (looks like @Entry but dosnt save and has no button */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) @@ -45,14 +44,31 @@ public class ConfigAnnotations { } + + + + + + + + @Deprecated + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.FIELD) + public @interface ScreenEntry + { + String name() default ""; + + int width() default 100; + } + /** * Adds a comment to the file. * * DONT USE AS IT WILL BE REMOVED IN THE REWORK OF THE CONFIG */ + @Deprecated @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) - @Deprecated public @interface FileComment { diff --git a/src/main/java/com/seibel/lod/core/config/ConfigEntry.java b/src/main/java/com/seibel/lod/core/config/ConfigEntry.java new file mode 100644 index 000000000..c31a4172a --- /dev/null +++ b/src/main/java/com/seibel/lod/core/config/ConfigEntry.java @@ -0,0 +1,59 @@ +package com.seibel.lod.core.config; + +/** + * Use for making the config variables + * + * @author coolGi2007 + * @version 02-03-2022 + */ +public class ConfigEntry { + public Object value; + public String comment; + // Should the min and max be long or int or double or something else + public double min = Double.MIN_VALUE; + public double max = Double.MAX_VALUE; + + + /** Gets the value */ + public Object get() { + return this.value; + } + /** Sets the value */ + public void set(Object new_value) { + this.value = new_value; + // Something to save the value + } + + /** Gets the min value */ + public double getMin() { + return this.min; + } + /** Sets the min value */ + public void setMin(double new_min) { + this.min = new_min; + } + /** Gets the max value */ + public double getMax() { + return this.max; + } + /** Sets the max value */ + public void setMax(double new_max) { + this.max = new_max; + } + + /** Gets the comment */ + public String getComment() { + return this.comment; + } + /** Sets the comment */ + public void setComment(String new_comment) { + this.comment = new_comment; + } + + /** Is the value of this equal to another */ + public boolean equals(ConfigEntry obj) { + if (this.value.equals(obj.value)) + return true; + return false; + } +}