Package civquest.io

Examples of civquest.io.DataToSave


  private static final String VEG_DEFS = "vegDefs";
  private static final String RES_DEFS = "resDefs";

  public DataToSave getPersistentData() {
    DataToSave data = new DataToSave();
    data.put(VEG_DEFS, new HashSet(vegetationDefinitions.values()));
    data.put(RES_DEFS, new HashSet(resourceDefinitions.values()));
    return data;
  }
View Full Code Here


      makeCompleteVisible(iterator.next());
    }
  }

  public DataToSave getPersistentData() {
    DataToSave data = new DataToSave();
    data.put("unitVisDist", unitVisibilityDistance);
    data.put("cityVisDist", cityVisibilityDistance);
    data.put("useTerrainVis", useTerrainVisibility);
    return data;
  }
View Full Code Here

        Registry ioRegistry = civQuest.getTopRegistry().getSubRegistry("io");
        Ruleset xmlSaveRuleset = ioRegistry.getRuleset("xmlSaveGame");

        File file = chooser.getSelectedFile();
        DataToSave data = constructDataToSave();
        XMLSaveGameWriter writer = new DefaultXMLSaveGameWriter(xmlSaveRuleset);
        writer.write(file, data);

      } catch (RulesetException ex) {
        CivQuest.showErrorQuitDialog("There was an error related to ruleset-loading: ",
View Full Code Here

      Messages.getMessages().info("SaveAction", "SaveGame", "Saving finished.");
    }
  }

  private DataToSave constructDataToSave() {
    DataToSave data = new DataToSave();

    Persistent game = Game.getGame();
      data.put("game", game);
    return data;
  }
View Full Code Here

    return new RestrictedToNation[] {new RestrictedToNation()};
  }

  public DataToSave getPersistentData() {
    // We don't need to save player, as class Player does this job
    DataToSave data = new DataToSave();
    data.put("id", id);
    data.put("whichVisManager", getVMEncodingFromInstance());
    data.put("name", name);
    data.put("visManager", visibilityManager);
     return data;
  }
View Full Code Here

  }

 

  public DataToSave getPersistentData() {
    DataToSave dataToSave = super.getPersistentData();
    dataToSave.put(HEALTH_KEY, health);
    dataToSave.put(TIME_KEY, time);
    dataToSave.put(SIZE_KEY, size);
    dataToSave.put(OWNER_KEY, getOwner().getID());
    return dataToSave;
  }
View Full Code Here

  }

  // we don't save anything

  public DataToSave getPersistentData() {
    return new DataToSave();
  }
View Full Code Here


  private static final String NAME_KEY = "name";

  public DataToSave getPersistentData() {
    DataToSave data = new DataToSave();
    data.put(NAME_KEY, name);
    return data;
  }
View Full Code Here

    public String toString(){
    return name;
  }

  public DataToSave getPersistentData() {
    DataToSave data = new DataToSave();
    data.put("id", id);
    data.put("name", name);
    data.put("nations", new HashSet(nations.keySet()));
   
    return data;
  }
View Full Code Here

   
  }

  public DataToSave getPersistentData() {

    DataToSave data = new DataToSave();
    data.put("timePerTurn", timePerTurn);
    data.put("whichMode", turnTimedMode.getModeName());
    data.put("modeDetails", turnTimedMode);

     return data;
  }
View Full Code Here

TOP

Related Classes of civquest.io.DataToSave

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.