This is more a question about structure than coding. So i have a class named Planet and all planets have their modifiers for example: Is breedable? Damageable? etc. I already have a base planet class but i dont know how i will do that in a scalable way since i need to check if any planet has a certain modifier.
BasePlanet class:
public class BasePlanet { private String name; private String[] about; private long entranceTax; private boolean locked, pvp; private int minRank; private World planetWorld; private Location spawn; private Material icon; public BasePlanet() { } public BasePlanet(String name, int minRank, long entranceTax, boolean pvp, boolean locked, Material icon, String... about) { this.name = name; this.about = about; this.minRank = minRank; this.entranceTax = entranceTax; this.locked = locked; this.icon = icon; this.pvp = pvp; this.planetWorld.setPVP(pvp); } ... Getters and Setters
Implementing BasePlanet
public class Mars extends BasePlanet{ public Mars() { super("Mars", 0, 0, true, false, Material.RED_SANDSTONE, "Este planeta contém pedras preciosas", "e itens especiais que nenhum outro planeta tem,", "ao menos que alguém tenha comercializado até", "este pequeno e cheio de surpresas, planeta vermelho." ); } }