This is my current enum class:
public enum BuildingType {
MINER("Miner", "A basic slave." (*, Miner (separate class)*)), FARM("Farm", "Old Macdonald's Crib."), BAKERY("Bakery", "Best Cookies in Town!"), FACTORY("Factory", "Highest Quality Memes in town!"), QUARRY("Quarry", "Let's get drilling!");
private String name;
private String description;
//private Class clazz;
BuildingType(String name, String description (* Possible to put Class clazz reference here? *)) {
this.name = name;
this.description = description;
//this.clazz = clazz
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public Class getReferencedClass() {
//Return referenced "clazz" above
}
}
As put in the comments and (* *), is it possible to reference a static class inside an enum so I can change static values inside that class by just referencing building type?
e.g.
BuildingType.MINER.getReferencedClass.setCookiesPerSecond(4);
Thanks all,
Jaco :)