I have a class that I want to use JUST for the sole purpose of storing all of my different entities in the game. This way I can retrieve a certain entity randomly. In another class I also have an entity Array List that's for the actual game play. How would I be able to create a new instance of an entity from the first array list in the second Array List? I tried doing the same process as just about anything else but I started getting options like adding a static suppress warning and a bunch of other thingamajigs that I do not understand.
First:
public class EntityList {
public static ArrayList<Entity> entityList;
public EntityList(){
entityList = new ArrayList<Entity>();
entityList.add(new Orc());
}
}
2nd Class:
switch(tileSetting){
case "Friendly":
break;
case "Hostile":
WANT TO CREATE INSTANCE OF ENEMY HERE.
break;
}