}
//TODO move expansion specific stuff
private void processFarmElement(Element e) {
String[] sides = asLocation(e);
Farm farm = new Farm();
farm.setId(game.idSequnceNextVal());
if (e.hasAttribute("city")) {
List<City> cities = new ArrayList<>();
String[] citiesLocs = asLocations(e, "city");
for (int j = 0; j < citiesLocs.length; j++) {
Location d = Location.valueOf(citiesLocs[j]);
for (Feature p : features) {
if (p instanceof City) {
if (d.isPartOf(p.getLocation())) {
cities.add((City) p);
break;
}
}
}
}
farm.setAdjoiningCities(cities.toArray(new Feature[cities.size()]));
}
if (attributeBoolValue(e, "pig")) {
//for river is pig herd always present
if (game.hasRule(CustomRule.PIG_HERD_ON_GQ_FARM) || tile.getId() != "GQ.F") {
farm.setPigHerd(true);
}
}
initFromDirList(farm, sides);
game.initFeature(tile, farm, e);
}