Browse Source

Effects.cfg parser

feature-config-parsing
FatBoy-DOTC 4 months ago
parent
commit
093ee9f59a
  1. 24
      src/engine/ConfigParsing/EffectsParser.java

24
src/engine/ConfigParsing/EffectsParser.java

@ -20,7 +20,7 @@ import java.util.ArrayList; @@ -20,7 +20,7 @@ import java.util.ArrayList;
import java.util.List;
public class EffectsParser {
public static String EffectsPath = ConfigManager.DEFAULT_DATA_DIR + "Effects.cfg";
public static String EffectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg";
public static void init() throws IOException {
ArrayList<ArrayList<String>> compiledData = new ArrayList<>();
String[] lines = readLines(EffectsPath);
@ -42,19 +42,15 @@ public class EffectsParser { @@ -42,19 +42,15 @@ public class EffectsParser {
CreateBlocks(compiledData);
}
public static String[] readLines(String filename) throws IOException {
File effectsCfg = new File("/home/mbdev/mb_dev/mb.data/Effects.cfg");
return effectsCfg.list();
//FileReader fileReader = new FileReader(filename);
//BufferedReader bufferedReader = new BufferedReader(fileReader);
//List<String> lines = new ArrayList<>();
// String line;
//while ((line = bufferedReader.readLine()) != null) {
// lines.add(line);
//}
//bufferedReader.close();
//return lines.toArray(new String[0]);
FileReader fileReader = new FileReader(filename);
BufferedReader bufferedReader = new BufferedReader(fileReader);
List<String> lines = new ArrayList<>();
String line;
while ((line = bufferedReader.readLine()) != null) {
lines.add(line);
}
bufferedReader.close();
return lines.toArray(new String[0]);
}
public static void CreateBlocks(ArrayList<ArrayList<String>> compiledData)
{

Loading…
Cancel
Save