void writeBinding(int fileIndex) { File bindingsFile = bindingFiles.get(fileIndex); try { ConfigParser.saveBindings(bindingsFile, bindingsOfFiles.get(fileIndex)); } catch (IOException e) { e.printStackTrace(); } }
void writeAllSummons() { Layer[] layers = Layer.values(); for (int i = 0; i < layers.length; i++) { Layer layer = layers[i]; File summonsFile = new File("./config/" + layer.name() + ".summons"); try { ConfigParser.saveSummons(summonsFile, summonsOfLayers.get(i)); } catch (IOException e) { e.printStackTrace(); } } }
void readAllSummons() { Layer[] layers = Layer.values(); for (Layer layer : layers) { File summonsFile = new File("./config/" + layer.name() + ".summons"); try { List<Summon> summons = ConfigParser.loadSummons(summonsFile); summonsOfLayers.add(summons); } catch (IOException e) { e.printStackTrace(); } } }
void readAllBindings() { File[] files = configRoot.listFiles(new ExtentionFilter(".bindings", false)); bindingFiles.addAll(Arrays.asList(files)); Collections.sort( bindingFiles, new Comparator<File>() { @Override public int compare(File arg0, File arg1) { return arg0.getName().compareTo(arg1.getName()); } }); for (File bindingsFile : bindingFiles) { try { List<BindingLayer> bindings = ConfigParser.loadBindings(bindingsFile); bindingsOfFiles.add(bindings); } catch (IOException e) { e.printStackTrace(); } } }