Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
  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;
  }