@Subscribe public void handleBlockadeConvoyReturns(ShipEntersPortEvent event) { // disolve the convoy and remove blockade from blockade state INavigableVessel vessel = event.getShip(); if (vessel instanceof IConvoy) { LocalDateTime now = date.getCurrentDate(); ICity aldermanCity = mapService.getAldermanCity(); for (Entry<ICity, IBlockade> blockadeEntry : blockadeState.entrySet()) { IBlockade blockade = blockadeEntry.getValue(); if (blockade.getEndBlockade().isBefore(now)) { IConvoy convoy = blockade.getBlockadeConvoy(); if (convoy.equals(vessel) && event.getCity().equals(aldermanCity)) { final ICity blockadedCity = blockadeEntry.getKey(); dissolveConvoy(blockade, aldermanCity, blockadedCity); blockadeState.finishBlockade(blockadedCity); IGuild guild = guildList.findGuild(aldermanCity).get(); for (IShip ship : blockade.getShipsToAuction()) { LocalDateTime auctionDate = now.plusDays(10); auctionDate = guildService.cleanUpAuctionAndDetermineAuctionDate(auctionDate, guild); IShipAuction auction = modelFactory.createAnonymousShipAuction(auctionDate, ship.getValue(), ship); guild.getAuctions().add(auction); } return; } } } } }
createConvoy(blockade, aldermanCity); IConvoy convoy = blockade.getBlockadeConvoy(); seafaringService.travelBetweenCities(convoy, blockadeCity);
case BLOCKADE: msg = new DisplayMessage("ch.sahits.game.openpatrician.engine.land.city.CityHallEngine.yesViolationBlockade", new Object[]{violation.getCity().getName()}); blockadeEngine.initializeNewBlockade(violation.getCity()); break; default: