diff --git a/ArcadeReader.java b/ArcadeReader.java index facd59c..cfe767c 100644 --- a/ArcadeReader.java +++ b/ArcadeReader.java @@ -2,7 +2,9 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.regex.Pattern; import java.awt.image.BufferedImage; public class ArcadeReader { @@ -77,13 +79,35 @@ class Box{ } class LoveLiveReader extends Reader{ LoveLiveReader(){ - readRegions.add(new Box(10,10,24,24)); - readRegions.add(new Box(10,40,24,24)); - readRegions.add(new Box(10,70,24,24)); + readRegions.add(new Box(10,10,24,24)); //score[0] + readRegions.add(new Box(10,40,24,24)); //rank[1] + readRegions.add(new Box(10,70,24,24)); //notes[2] + readRegions.add(new Box(10,70,24,24)); //notes[3] + readRegions.add(new Box(10,70,24,24)); //notes[4] + readRegions.add(new Box(10,70,24,24)); //notes[5] + readRegions.add(new Box(10,70,24,24)); //notes[6] + readRegions.add(new Box(10,70,24,24)); //notes[7] + readRegions.add(new Box(10,70,24,24)); //notes[8] + readRegions.add(new Box(10,70,24,24)); //difficulty[9] + readRegions.add(new Box(10,70,24,24)); //title[10] + readRegions.add(new Box(10,70,24,24)); //pct[11] + readRegions.add(new Box(10,70,24,24)); //maxcombo[12] + readRegions.add(new Box(10,70,24,24)); //other...[13] } void interpretBoxes(Path img){ String dataString = readAllBoxes(img); - System.out.println(dataString); + String[] data = dataString.split(Pattern.quote("\n")); + String[] ja_data = data[0].split(Pattern.quote(")")); + String[] en_data = data[2].split(Pattern.quote(")")); + trimAllData(ja_data); + trimAllData(en_data); + System.out.println(Arrays.toString(ja_data)); + System.out.println(Arrays.toString(en_data)); + for (int i=0;i