City: mergeWith

This commit is contained in:
Roman Inflianskas 2016-05-17 23:17:49 +03:00
parent 9c0d321104
commit 1550133aec

View file

@ -140,4 +140,15 @@ public class City extends MapObject {
this.isin = isin;
}
public void mergeWith(City city) {
for (Street street : city.listOfStreets) {
if (listOfStreets.contains(street)) {
listOfStreets.get(listOfStreets.indexOf(street)).mergeWith(street);
} else {
listOfStreets.add(street);
}
}
copyNames(city);
}
}