Коммит на паре
This commit is contained in:
parent
89342ecb23
commit
748584bfde
@ -38,7 +38,7 @@ public class FormMapWithArmoredCars extends JFrame{
|
||||
|
||||
public FormMapWithArmoredCars() {
|
||||
super("Карта с набором объектов");
|
||||
setBounds(100, 100, 1000, 700);
|
||||
setBounds(100, 100, 1000, 725);
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
JMenuBar jMenuBar = new JMenuBar();
|
||||
|
@ -146,6 +146,10 @@ public class MapWithSetArmoredCarsGeneric<T extends IDrawingObject, U extends Ab
|
||||
return _setCars;
|
||||
}
|
||||
|
||||
public void removeAllCars() {
|
||||
_setCars.Clear();
|
||||
}
|
||||
|
||||
public String GetData(char separatorType, char separatorData)
|
||||
{
|
||||
String data = String.format("%s%s", _map.getClass().getName(), separatorType);
|
||||
|
@ -150,6 +150,9 @@ public class MapsCollection {
|
||||
map = new MyMapWooden();
|
||||
break;
|
||||
}
|
||||
if (_mapStorages.containsKey(elem[0])) {
|
||||
_mapStorages.get(elem[0]).removeAllCars();
|
||||
}
|
||||
_mapStorages.put(elem[0], new MapWithSetArmoredCarsGeneric<>(_pictureWidth, _pictureHeight, map));
|
||||
_mapStorages.get(elem[0]).LoadData(elem[2].split(String.valueOf(separatorData)));
|
||||
} catch (IOException e) {
|
||||
|
@ -48,4 +48,8 @@ public class SetArmoredCarsGeneric<T> {
|
||||
{
|
||||
return () -> _places.stream().filter(Objects::nonNull).iterator();
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
_places.clear();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user