Package civquest.io

Examples of civquest.io.LoadedData


      id = loadedData.getLong("id");
      resToThisNation = new RestrictedToNation(id);
      name = loadedData.getString("name");

      String whichVisManager = loadedData.getString("whichVisManager");
      LoadedData visData = loadedData.getSubData("visManager");
      if (whichVisManager.equals(REALITY_VISIBILITY)) {
        Registry realityRegistry = visibilityRegistry.getSubRegistry("reality");
        this.visibilityManager = new RealityVisibilityManager(realityRegistry, this);
      } else if (whichVisManager.equals(BLACK_WHITE_VISIBILITY)) {
        Registry blackWhiteRegistry = visibilityRegistry.getSubRegistry("blackWhite");
View Full Code Here


        Ruleset xmlSaveRuleset = ioRegistry.getRuleset("xmlSaveGame");

        File file = chooser.getSelectedFile();

        XMLSaveGameReader reader = new SaxSaveGameReader(xmlSaveRuleset);
        LoadedData data = reader.read(file);

        Messages.getMessages().info("LoadAction", "SaveGame", "Loaded data: " + data);
       
        processLoadedData(data);
View Full Code Here

  }

  private void loadGame(LoadedData data) {
    try {
      Registry registry = civQuest.getTopRegistry();
      LoadedData gameData = data.getSubData("game");
      Game.constructGame(registry, gameData, Persistent.LoadingStep.CONSTRUCT);
      Game.getGame().setPersistentData(Persistent.LoadingStep.REFERENCE);
      GUIBuilder.buildGameGUI(civQuest);
    } catch (Exception e) {
      CivQuest.showErrorDialog("Error when loading savegame.  " +
View Full Code Here

  }

  private void loadScenario(LoadedData data) {
    try {
      Registry registry = civQuest.getTopRegistry();
      LoadedData gameData = data.getSubData("game");     
      Game.constructGame(registry, gameData, Persistent.LoadingStep.CONSTRUCT);
      Game.getGame().setPersistentData(Persistent.LoadingStep.REFERENCE);
      GUIBuilder.buildScenarioEditorGUI(civQuest);
    } catch (Exception e) {
      CivQuest.showErrorDialog("Error when loading saved scenario.  "
View Full Code Here

    elementStack = new LinkedList<Element>();
    whereAreWeStack = new LinkedList<String>();

    whereAreWe = "Shortly after start.";

    loadedData = new LoadedData();
  }
View Full Code Here

      timePerTurn = loadedData.getInt("timePerTurn");
   
      String whichMode = loadedData.getString("whichMode");
      constructTimePerTurnMode(whichMode);

      LoadedData modeSpecificData = loadedData.getSubData("modeDetails");
      turnTimedMode.setLoadedData(modeSpecificData);
    }

    turnTimedMode.setPersistentData(step);
 
View Full Code Here

       constructMap(step);
       constructPlayers(step);
       constructNations(step);

      Ruleset timeRuleset = registry.getSubRegistry("rules").getRuleset("time");
      LoadedData timeRulesData = loadedData.getSubData("timeRules");
      timeRules = new TimeRules(timeRuleset, timeRulesData, step);

      LoadedData idManagerData = loadedData.getSubData("idManager");
      idManager = new IDManager(idManagerData, step);
     
      LoadedData turnManagerData = loadedData.getSubData("turnManager");
      turnManager = new TurnManager(turnManagerData, step);
    } else if (step == LoadingStep.REFERENCE) {
      // We need to say mapData who rules it.  Afterwards (in its
      // REFERENCE-step), MapData can tell us about MapObjects etc.
      mapData.setGameReference(this);
View Full Code Here

  }

  private void constructMap(LoadingStep step)
    throws Exception {
    String mapType = loadedData.getString("mapType");
    LoadedData mapDataData = loadedData.getSubData("mapData");
    if (mapType.equals("Flat")) {
      assert false : "Flat case not implemented!";
    } else if (mapType.equals("Iso")) {
      mapData = new IsoMapData(this, registry, mapDataData, step);
    } else {
View Full Code Here

  public void setPersistentData(LoadingStep step)
    throws Exception {
   
    if (step == LoadingStep.CONSTRUCT) {
      LoadedData configData = loadedData.getSubData(CONFIG_KEY);
      config = new Configuration(mapRegistry, configData, step);

      mapHeight = loadedData.getInt(MAP_HEIGHT_KEY);
      mapWidth = loadedData.getInt(MAP_WIDTH_KEY);
      flatEarth = loadedData.getBoolean(FLAT_EARTH_KEY);
View Full Code Here

TOP

Related Classes of civquest.io.LoadedData

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.