import java.util.ArrayList; import java.util.HashMap; public class MapsCollection { private final HashMap> _mapStorages; public ArrayList Keys() { return new ArrayList<>(_mapStorages.keySet()); } private final int _pictureWidth; private final int _pictureHeight; public MapsCollection(int pictureWidth,int pictureHeight) { _mapStorages=new HashMap<>(); _pictureWidth=pictureWidth; _pictureHeight=pictureHeight; } public void AddMap(String Name, AbstractMap Map) { if(!_mapStorages.containsKey(Name)) { _mapStorages.put(Name,new MapWithSetBoatsGeneric<>(_pictureWidth,_pictureHeight,Map)); } } public void DelMap(String name) { _mapStorages.remove(name); } public MapWithSetBoatsGeneric Get(String ind) { if(_mapStorages.containsKey(ind)) { return _mapStorages.get(ind); } return null; } public DrawningObjectBoat Get(String name, int ind) { if (_mapStorages.containsKey(name)) { return _mapStorages.get(name).GetSelectedBoat(ind); } return null; } }