@Subscribe public void handleShipReachesDestination(ShipArrivesAtDestinationEvent event) { INavigableVessel vessel = event.getShip(); vessels.remove(vessel); } }
clientServerEventBus.post(new ShipArrivesAtDestinationEvent(vessel, destination)); if (vessel.getOwner() instanceof IHumanPlayer) { DisplayMessage msg = new DisplayMessage("ch.sahits.game.openpatrician.engine.sea.model.ShipPositionUpdateTask.shipArrivedAtDestination",
@Subscribe public void handleShipReachesDestination(ShipArrivesAtDestinationEvent event) { INavigableVessel vessel = event.getShip(); TravellingVessel ship = vessels.getTravellingVessel(vessel); final Path drawablePath = ship.getDrwawablePath(); if (drawablePath != null) { Platform.runLater(() -> shipCanvas.getChildren().remove(drawablePath)); } } @Subscribe
/** * Ship has reached it's destination, select a new one. * @param event ship arrives at destination */ @Subscribe public void handleShipReachesDestination(ShipArrivesAtDestinationEvent event) { INavigableVessel vessel = event.getShip(); if (handlePirateShip(vessel)) { int damageInv = vessel.getDamage(); if (damageInv < 20) { selectDestination((ISeaPirate) vessel.getOwner()); } else { sendForRepairs(vessel); } } } /** * Select a new destination for the pirate.