public class MapData {
ArrayList<String> Redsp = new ArrayList<String>();
ArrayList<String> Bluesp = new ArrayList<String>();
ArrayList<String> Playersp = new ArrayList<String>();
public MapData(ArrayList<String> redsp, ArrayList<String> bluesp, ArrayList<String> playersp) {
Redsp = redsp;
Bluesp = bluesp;
Playersp = playersp;
}
}
How do I make a object of MapData, and add/remove items to/from the object?
I would like to add like 6 items to bluesp and redsp, and 20 to playersp.
MapData TEST = new MapData(null,null,null);
TEST.??
I would create some more methods to MapData
For example to add to Bluesp
Also I would use camelCase as this is the standard thing to do in Java.
I would probably recommend creating the ArrayLists inside the ctor too as there is little point passing them into an object and then using that object to add/remove items from them. If you have the ArrayList you could add them outside of this object. But that is a design thing…