public int getBarnPoints() { // note: pigHerd has no influence on barn points int points = adjoiningCityOfCarcassonne ? 4 : 0; points += 5 * adjoiningCastles.size(); if (getGame().hasCapability(SiegeCapability.class)) { for (CityScoreContext ctx : adjoiningCompletedCities.values()) { points += 4; if (ctx.isBesieged()) { // count city twice points += 4; } } } else { points += adjoiningCompletedCities.size() * 4; } return points; }
private int getPlayerPoints(Player player, int pointsPerCity) { int points = adjoiningCityOfCarcassonne ? pointsPerCity : 0; points += (pointsPerCity + 1) * adjoiningCastles.size(); // optimalization if (!getGame().hasCapability(SiegeCapability.class)) { points += pointsPerCity * adjoiningCompletedCities.size(); return points; } for (CityScoreContext ctx : adjoiningCompletedCities.values()) { points += pointsPerCity; if (ctx.isBesieged()) { // count city twice points += pointsPerCity; } } return points; }