Added some stuff to get ready for the new config

This commit is contained in:
coolGi2007
2022-02-03 03:41:54 +00:00
parent ca81ed1efe
commit a0dd0d5aca
2 changed files with 81 additions and 6 deletions
@@ -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
{
@@ -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;
}
}