Exemplo n.º 1
0
  /**
   * 建造ドックの投入資源を削除します
   *
   * @param dock ドック
   * @throws IOException IOException
   */
  public static void remove(String dock) throws IOException {
    if (mapBean != null) {
      mapBean.getKdockMap().remove(dock);
    }

    BeanUtils.writeObject(AppConstants.KDOCK_CONFIG_FILE, mapBean);
  }
Exemplo n.º 2
0
 /** 設定ファイルに書き込みます */
 public static void store() throws IOException {
   if (Holder.instance == null) {
     return;
   }
   // 最終更新日時がファイル更新日時より新しい時だけ書き込む
   if (modified) {
     ApplicationMain.sysPrint("マスターファイル更新");
     BeanUtils.writeObject(AppConstants.MASTER_DATA_CONFIG, Holder.instance);
     modified = false;
   }
 }
Exemplo n.º 3
0
  /**
   * 建造ドックの投入資源を設定します
   *
   * @param dock ドック
   * @param resource 資源
   * @throws IOException IOException
   */
  public static void store(String dock, ResourceDto resource) throws IOException {
    if (mapBean == null) {
      mapBean = new KdockMapBean();
    }
    KdockBean kdock = new KdockBean();
    kdock.setType(resource.getType());
    kdock.setFuel(resource.getFuel());
    kdock.setAmmo(resource.getAmmo());
    kdock.setMetal(resource.getMetal());
    kdock.setBauxite(resource.getBauxite());
    kdock.setResearchMaterials(resource.getResearchMaterials());
    kdock.setShipId(resource.getSecretary().getId());
    kdock.setHqLevel(resource.getHqLevel());
    kdock.setFreeDock(resource.getFreeDock());
    mapBean.getKdockMap().put(dock, kdock);

    BeanUtils.writeObject(AppConstants.KDOCK_CONFIG_FILE, mapBean);
  }