Пример #1
0
 public void remove(Town town) {
   for (TownBlock townBlock : town.getTownBlocks()) remove(townBlock.getWorldCoord());
   warringTowns.remove(town);
   try {
     if (!townsLeft(town.getNation())) eliminate(town.getNation());
   } catch (NotRegisteredException e) {
   }
 }
Пример #2
0
 public void add(Town town) {
   TownyMessaging.sendTownMessage(town, TownySettings.getJoinWarMsg(town));
   townScores.put(town, 0);
   warringTowns.add(town);
   for (TownBlock townBlock : town.getTownBlocks())
     if (town.isHomeBlock(townBlock))
       warZone.put(townBlock.getWorldCoord(), TownySettings.getWarzoneHomeBlockHealth());
     else warZone.put(townBlock.getWorldCoord(), TownySettings.getWarzoneTownBlockHealth());
 }
Пример #3
0
  public void remove(Town attacker, Town town) throws NotRegisteredException {
    townScored(attacker, TownySettings.getWarPointsForTown());

    for (TownBlock townBlock : town.getTownBlocks()) remove(townBlock.getWorldCoord());
    warringTowns.remove(town);
    try {
      if (!townsLeft(town.getNation())) eliminate(town.getNation());
    } catch (NotRegisteredException e) {
    }
  }
Пример #4
0
 public int countActiveWarBlocks(Town town) {
   int n = 0;
   for (TownBlock townBlock : town.getTownBlocks())
     if (warZone.containsKey(townBlock.getWorldCoord())) n++;
   return n;
 }