Сдача 6-й лабораторной.

This commit is contained in:
Programmist73 2022-11-22 10:50:47 +04:00
parent 781a54e437
commit f9ca76a425
2 changed files with 15 additions and 8 deletions

View File

@ -17,13 +17,13 @@ public class MapWithSetPlanesGeneric <T extends IDrawningObject, U extends Abstr
private final int _placeSizeHeight = 90;
//набор объектов
private final SetPlanesGeneric<T> _setPlanes;
private SetPlanesGeneric<T> _setPlanes;
//набор удалённых объектов (двусвязный список)
public final LinkedList<T> _deletePlane;
//карта
private final U _map;
private U _map;
//конструктор
public MapWithSetPlanesGeneric(int picWidth, int picHeight, U map)
@ -235,6 +235,12 @@ public class MapWithSetPlanesGeneric <T extends IDrawningObject, U extends Abstr
}
}
//очистка и ключа, и значения по ключу
public void Clear()
{
_setPlanes = null;
}
public T GetPlaneInList(int index)
{
return _setPlanes.Get(index);

View File

@ -201,15 +201,16 @@ public class MapsCollection
break;
}
//если имя загружаемой карты уже есть в коллекции
if (_mapStorage.get(element[0]) != null) {
_mapStorage.remove(element[0]);
//если имя загружаемой карты есть в коллекции
if (_mapStorage.get(element[0]) != null)
{
_mapStorage.get(element[0]).Clear();
}
_mapStorage.put(element[0], new MapWithSetPlanesGeneric<IDrawningObject, AbstractMap>(_pictureWidth, _pictureHeight,
map));
_mapStorage.put(element[0], new MapWithSetPlanesGeneric<IDrawningObject, AbstractMap>
(_pictureWidth, _pictureHeight, map));
_mapStorage.get(element[0]).LoadData(element[2].split(String.valueOf(separatorData)));
} catch (Exception ex) { }
}
}