I currently have an array of type Class which holds only sub-classes of type BuildingComplex. It basically holds all of the different classes that are allowed to be constructed for game I am creating.
private static Class[] AVAILABLE = new Class[]{
LumberCamp.class, Farm.class, Storehouse.class, Port.class, Barracks.class, Edifice.class
};
When I want to access a static variable from one of these classes (all which have this static variable due to inheritance from BuildingComplex), I cannot determine how to have AVAILABLE[i] access static variables because I cannot find any resource that will cast Class to a specific class.
Thank you in advance.
not sure if i completely understand your question, but are you looking for something like this?