- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
/** * Recieve the event from the event bus and delegate it. * @param event shipyard order refit */ @Subscribe public void handleORderRefit(ShipyardOrderRefit event) { refit(event.getShipyard(), event.getShip(), event.getUpgradeLevel(), event.getProxy()); } @VisibleForTesting
@Override protected EventHandler<MouseEvent> getAction() { return mouseEvent -> { Optional<ITradingOffice> office = getPlayer().findTradingOffice(getCity()); Preconditions.checkArgument(office.isPresent(), "Trading office must be present"); for (EWare ware : MATERIALS) { int buyAmount = requirementsMap.get(ware).getBuyAmount().intValue(); getCity().move(ware, -buyAmount, getPlayer()); int needed = shipFactory.getUpgradeAmount(currentShip.get().getShipType(), ware); int fromWarhouse = needed - buyAmount; office.get().move(ware, -fromWarhouse, 0); } ShipyardOrderRefit event = new ShipyardOrderRefit(getCity().getCityState().getShipyardState(),currentShip.get(), currentShip.get().getShipUpgradeLevel().nextLevel(), city); clientServerEventBus.post(event); city.getPlayersShips().remove(currentShip.get()); getPlayer().getCompany().updateCash(-calculateTotalUpgradeCosts()); executeOnCloseButtonClicked(); }; }