So I’m working in a game that I want to add mod support into, and have a question. How should I go about making raw material in the game? So far I have been thinking of having a abstract class called “material” which look something like this.
[quote]public abstract class Material {
private int amount = 1;
private final String name;
private BufferedImage icon;
public Material(String name, BufferedImage icon){
this.name = name;
this.icon = icon;
}
public Material(String name, BufferedImage icon, int amount){
this.name = name;
this.icon = icon;
this.amount = amount;
}
public String getName(){
return name;
}
public BufferedImage getIcon(){
return icon;
}
public int getAmount(){
return amount;
}
public void setAmount(int i){
amount = i;
}
}
[/quote]
The point of this class is to be able to easily create new raw material, and add it into the game. But I’m sure this is not the best way to go about it, normally I would just a enum to make all the material, but since I want to have mod support inform of adding .jar file into a mod folder that’s not really an option since from what I know I can’t add things into a enum without changing the source code.