Ok, so I’m planning on using ArrayList<> to add a PlayerRocket every time a rocket is fired.
I know that I can add them by using the add(Object o) method of the ArrayList<>.
Now what my problem is, is that my PlayerRocket has a boolean which says whether the rocket is active or not, and when that equals false, i need to remove that specific rocket from the arraylist. When i read the documentation, it says that using the method remove(Object o) removes the first one of that object off the list, how can i remove specific ones.
OR
is there an alternative, maybe where i can create my own ArrayList<> type class because i will need to iterate through the list as well?
Any help much appreciated