So im having a problem on my game because i cant figure out how to handle my Explosion ArrayList since i need to add elements to it from several different places, and while searching a solution to this, i came up with a very messy solution which would be:
import java.util.ArrayList;
public final class Factory {
private static ArrayList<Explosion> booms = new ArrayList<Explosion>();
public static void addBoom()
{
booms.add(new Explosion());
}
public static ArrayList<Integer> getBooms() {return booms;}
}
I know, it looks awful, but how awful is it? My question is if this is a viable solution or just plain silly and why would it be such. Yes, im making it global (i guess) but its not the worse global there is or is it?