/** * 建造ドックの投入資源を取得します * * @param dock ドック * @return 建造ドックの投入資源 */ @CheckForNull public static ResourceDto load(String dock) { try { if (mapBean == null) { mapBean = BeanUtils.readObject(AppConstants.KDOCK_CONFIG_FILE, KdockMapBean.class); } if (mapBean != null) { KdockBean kdock = mapBean.getKdockMap().get(dock); if (kdock == null) { return null; } Map<Long, ShipDto> ships = ShipContext.get(); if (!ships.isEmpty() && ships.containsKey(kdock.getShipId())) { ResourceDto resource = new ResourceDto( kdock.getType(), kdock.getFuel(), kdock.getAmmo(), kdock.getMetal(), kdock.getBauxite(), kdock.getResearchMaterials(), ships.get(kdock.getShipId()), kdock.getHqLevel()); resource.setFreeDock(kdock.getFreeDock()); return resource; } } } catch (Exception e) { LoggerHolder.LOG.warn("建造ドックの投入資源を取得しますに失敗しました", e); } return null; }