@Subscribe public void handleBuildingNotAuction(BuildingNotAuctioned event) { if (event.getNewOwner() instanceof IHumanPlayer) { // Post targeted message ICity city = event.getBuilding().getCity(); DisplayMessage msg = new DisplayMessage("ch.sahits.game.openpatrician.engine.player.HumanPlayerEngine.buildingNotAuctioned", city.getName()); TargetedEvent targetMsg = new TargetedEvent((IHumanPlayer) event.getNewOwner(), msg); clientServerEventBus.post(targetMsg); } } }
@Override public void run() { if (run) { if (auction instanceof IShipAuction) { if (auction.getOwner().isPresent()) { IShipAuction shipAuction = (IShipAuction) auction; clientServerEventBus.post(new ShipNotAuctioned(shipAuction.getAuctionedShip(), shipAuction.getOwner().get())); } } else { IBuildingAuction buildingAuction = (IBuildingAuction) auction; clientServerEventBus.post(new BuildingNotAuctioned(buildingAuction.getAuctionedBuilding(), buildingAuction.getOwner().get())); } } } };