import java.util.*; //класс для хранения коллекции карт public class MapsCollection { //словарь (хранилище) с картами public HashMap> _mapStorage; //возвращение списка названий карт public List Keys; //ширина окна отрисовки private final int _pictureWidth; //высота окна отрисовки private final int _pictureHeight; //конструктор public MapsCollection(int pictureWidth, int pictureHeight) { Keys = new ArrayList(_mapStorage.keySet()); _mapStorage = new HashMap<>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } //добавление карты public void AddMap(String name, AbstractMap map) { if(_mapStorage.containsKey(name)) { return; } _mapStorage.put(name, new MapWithSetPlanesGeneric<>(_pictureWidth, _pictureHeight, map)); } //удаление карты public void DelMap(String name) { _mapStorage.remove(name); } //Доступ к аэродрому public MapWithSetPlanesGeneric get(String index) { if(_mapStorage.containsKey(index)) { return _mapStorage.get(index); } return null; } public DrawningObjectPlane Get(String name, int index) { if(_mapStorage.containsKey(name)) { return _mapStorage.get(name).GetPlaneInList(index); } return null; } }