diff options
Diffstat (limited to 'src/main/java/kubatech/api/enums/EIGModes.java')
-rw-r--r-- | src/main/java/kubatech/api/enums/EIGModes.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main/java/kubatech/api/enums/EIGModes.java b/src/main/java/kubatech/api/enums/EIGModes.java new file mode 100644 index 0000000000..a81de2b8c5 --- /dev/null +++ b/src/main/java/kubatech/api/enums/EIGModes.java @@ -0,0 +1,42 @@ +package kubatech.api.enums; + +import java.util.HashMap; + +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import kubatech.api.eig.EIGMode; +import kubatech.tileentity.gregtech.multiblock.eigmodes.EIGIC2Mode; +import kubatech.tileentity.gregtech.multiblock.eigmodes.EIGNormalMode; + +public class EIGModes { + + private static final HashMap<String, EIGMode> modes = new HashMap<>(); + + public static final EIGMode Normal = addMode(EIGNormalMode.instance); + public static final EIGMode IC2 = addMode(EIGIC2Mode.instance); + + // this is basically a fake enum, plz don't instantiate + private EIGModes() {} + + private static EIGMode addMode(EIGMode mode) { + modes.put(mode.getName(), mode); + return mode; + } + + public static EIGMode getModeFromName(String name) { + return modes.get(name); + } + + public static EIGMode getNextMode(EIGMode from) { + int id = (from.getUIIndex() + 1) % modes.size(); + for (EIGMode mode : modes.values()) { + if (mode.getUIIndex() == id) return mode; + } + return Normal; + } + + public static void addTooltipInfo(GT_Multiblock_Tooltip_Builder tt) { + // maybe make this use the mods list instead + EIGModes.Normal.addTooltipInfo(tt); + EIGModes.IC2.addTooltipInfo(tt); + } +} |