package com.yolp900.itsjustacharm.config; import com.yolp900.itsjustacharm.reference.LibConfig; public enum ModConfigs { WAILAIntegration(LibConfig.WAILAIntegration, ModConfigCategories.Integration, true), LatinBlocksConnecting(LibConfig.LatinBlocksConnecting, ModConfigCategories.GENERAL, true), LevitatorRange(LibConfig.LevitatorRange, ModConfigCategories.GENERAL, 8.0F, 2.0F, 16.0F), BaublesIntegration(LibConfig.BaublesIntegration, ModConfigCategories.Integration, true); private String title; private String desc; private configTypes type; private ModConfigCategories category; ModConfigs(LibConfig config, ModConfigCategories category, boolean booleanDefault) { setConfig(config, category); this.type = configTypes.Boolean; this.booleanDefault = booleanDefault; } ModConfigs(LibConfig config, ModConfigCategories category, float floatDefault, float floatMin, float floatMax) { setConfig(config, category); this.type = configTypes.Float; this.floatDefault = floatDefault; this.floatMin = floatMin; this.floatMax = floatMax; } ModConfigs(LibConfig config, ModConfigCategories category, int intDefault, int intMin, int intMax) { setConfig(config, category); this.type = configTypes.Int; this.intDefault = intDefault; this.intMin = intMin; this.intMax = intMax; } ModConfigs(LibConfig config, ModConfigCategories category, String stringDefault, String... stringValidValues) { setConfig(config, category); this.type = configTypes.String; this.stringDefault = stringDefault; this.stringValidValues = stringValidValues; } private void setConfig(LibConfig config, ModConfigCategories category) { this.title = config.getTitle(); this.desc = config.getDescription(); this.category = category; } public String getTitle() { return title; } public String getDesc() { return desc; } public ModConfigCategories getCategory() { return category; } public configTypes getType() { return type; } private boolean booleanDefault; private boolean booleanValue; private float floatDefault; private float floatMin; private float floatMax; private float floatValue; private int intDefault; private int intMin; private int intMax; private int intValue; private String stringDefault; private String[] stringValidValues; private String stringValue; public boolean getBooleanDefault() { return booleanDefault; } public float getFloatDefault() { return floatDefault; } public float getFloatMin() { return floatMin; } public float getFloatMax() { return floatMax; } public int getIntDefault() { return intDefault; } public int getIntMin() { return intMin; } public int getIntMax() { return intMax; } public String getStringDefault() { return stringDefault; } public String[] getStringValidValues() { return stringValidValues; } public boolean getValueB() { return booleanValue; } public void setValueB(boolean booleanValue) { this.booleanValue = booleanValue; } public float getValueF() { return floatValue; } public void setValueF(float floatValue) { this.floatValue = floatValue; } public int getValueI() { return intValue; } public void setValueI(int intValue) { this.intValue = intValue; } public String getValueS() { return stringValue; } public void setValueS(String stringValue) { this.stringValue = stringValue; } public enum ModConfigCategories { GENERAL(LibConfig.Categories.GENERAL), Integration(LibConfig.Categories.Integration), Mechanics(LibConfig.Categories.Mechanics); private String name; ModConfigCategories(LibConfig.Categories category) { this.name = category.getName(); } public String getName() { return name; } } enum configTypes { Boolean, Float, Int, String } }