Package net.zurvanlabs.math.configuration.file

Examples of net.zurvanlabs.math.configuration.file.YamlConfiguration


    }
  }
 
  public static void main(String[] args)
      throws SlickException, FileNotFoundException, IOException, InvalidConfigurationException {
    yamlSettings = new YamlConfiguration();
   
    try {
      yamlSettings.load("settings.yml");
    } catch (FileNotFoundException e) {
      yamlSettings.set("settings.yamlGridX", 20);
      yamlSettings.set("settings.yamlGridY", 20);
      yamlSettings.set("settings.yamlGridW", 20);
      yamlSettings.set("settings.yamlGridH", 20);
      yamlSettings.set("settings.title", "Title");
      yamlSettings.set("settings.gui.yamlGuiFilename", "grid.yml");
      yamlSettings.set("settings.gui.yamlElementPrefix", "e_");
      yamlSettings.set("settings.gui.yamlLastID", "lid");
     
      yamlSettings.save("settings.yml");
      yamlSettings.load("settings.yml");
    }
   
    Source.yamlGridX = yamlSettings.getInt("settings.yamlGridX");
    Source.yamlGridY = yamlSettings.getInt("settings.yamlGridY");
    GuiElement.yamlGridW = yamlSettings.getInt("settings.yamlGridW");
    GuiElement.yamlGridH = yamlSettings.getInt("settings.yamlGridH");
    GuiElement.yamlGuiFilename = yamlSettings.getString("settings.gui.yamlGuiFilename");
    GuiElement.yamlPrefix = yamlSettings.getString("settings.gui.yamlElementPrefix");
    GuiElement.yamlLastID = yamlSettings.getString("settings.gui.yamlLastID");
    String title = yamlSettings.getString("settings.title");
   
    yamlElements = new YamlConfiguration();
   
    try {
      yamlElements.load(GuiElement.yamlGuiFilename);
    } catch (FileNotFoundException e) {
      yamlElements.set(GuiElement.yamlLastID, 0);
View Full Code Here

TOP

Related Classes of net.zurvanlabs.math.configuration.file.YamlConfiguration

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.