City: mergeWith
This commit is contained in:
parent
9c0d321104
commit
1550133aec
1 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue