Package civquest.parser.ruleset

Examples of civquest.parser.ruleset.Registry


        //get all available nations
        this.addNationsToCombo();
       
        //get all available units
        Registry unitsRegistry = registry.getSubRegistry(unitsRuleset);
        String[] units = unitsRegistry.getAllRulesets();
        this.unitsCombo = new JComboBox(units);

    }
View Full Code Here


  private LoadedData loadedData = null;

  Configuration(Registry mapRegistry) throws ConfigurationException {
    loadVegetationDefinitions(mapRegistry.getRuleset("vegetation"));
    Registry resourceRegistry = mapRegistry.getSubRegistry("resource");
    loadResourceDefinitions(resourceRegistry);
  }
View Full Code Here

      Messages.getMessages().info("SaveAction", "SaveGame", "Starting to save to "
                    + chooser.getSelectedFile());

      try {

        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);
View Full Code Here

      }
    }
  }

  private void loadConfiguration(Registry registry) throws RulesetException {
    Registry mapRegistry = registry.getSubRegistry("map");
    Ruleset flatRuleset = mapRegistry.getRuleset("flat");
    Section distSection = flatRuleset.getSection("distances");
    diagonalDistance = distSection.getField("diagonal").getIntValue();
    straightDistance = distSection.getField("straight").getIntValue();
 
View Full Code Here

      setUpBlackWhiteVisManager();
    }
  }

  private void setUpRealityVisManager() throws RulesetException {
    Registry realityRegistry = visibilityRegistry.getSubRegistry("reality");
    this.visibilityManager = new RealityVisibilityManager(realityRegistry, this);
  }
View Full Code Here

    Registry realityRegistry = visibilityRegistry.getSubRegistry("reality");
    this.visibilityManager = new RealityVisibilityManager(realityRegistry, this);
  }

  private void setUpBlackWhiteVisManager() throws RulesetException {
    Registry blackWhiteRegistry = visibilityRegistry.getSubRegistry("blackWhite");
    this.visibilityManager = new BlackWhiteVisibilityManager(blackWhiteRegistry, this);
  }
View Full Code Here

      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");
        this.visibilityManager
          = new BlackWhiteVisibilityManager(blackWhiteRegistry, this, visData, step);
      } else {
        assert false : "TODO: Throw exception!";
      }
View Full Code Here

                    + chooser.getSelectedFile());

      try {
        GUIBuilder.killGUI(civQuest);

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

        File file = chooser.getSelectedFile();

        XMLSaveGameReader reader = new SaxSaveGameReader(xmlSaveRuleset);
        LoadedData data = reader.read(file);
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) {
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) {
View Full Code Here

TOP

Related Classes of civquest.parser.ruleset.Registry

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.