Update imgparser for new DLC.
This commit is contained in:
parent
9750a18fdf
commit
f417c30976
@ -159,9 +159,8 @@ public class Controller {
|
||||
File tmp = new File("tmp");
|
||||
if (tmp.exists()) {
|
||||
FileUtils.deleteFile(tmp);
|
||||
} else {
|
||||
tmp.mkdir();
|
||||
}
|
||||
tmp.mkdir();
|
||||
String song = getSongTitle(img);
|
||||
|
||||
ImageIO.write(img,"png",new File("tmp/image.png"));
|
||||
|
@ -34,7 +34,7 @@ public class DemoApplication {
|
||||
static TestResult result = null;
|
||||
static Integer generation = 30; //Confidence level.
|
||||
|
||||
final static boolean REDO_COLOR_DATA = false;
|
||||
final static boolean REDO_COLOR_DATA = true;
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
SpringApplication.run(DemoApplication.class, args);
|
||||
@ -121,6 +121,22 @@ public class DemoApplication {
|
||||
System.out.println("All Tests passed!");
|
||||
}
|
||||
|
||||
public static String getCorrectSongName(String song) {
|
||||
switch (song.toLowerCase()) {
|
||||
case "pianogirl":{
|
||||
return "PIANO*GIRL";
|
||||
}
|
||||
case "16 -out of the gravity-":{
|
||||
return "1/6 -out of the gravity-";
|
||||
}
|
||||
case "ファインダー (DSLR remix - reedit)":{
|
||||
return "ファインダー (DSLR remix - re:edit)";
|
||||
}
|
||||
default:
|
||||
return song;
|
||||
}
|
||||
}
|
||||
|
||||
static void RunTest(String _img,String _song,int _cool,int _fine, int _safe, int _sad, int _worst, float _percent,boolean _fail,String _difficulty,String _mod
|
||||
,int _combo,int _score,boolean debug) throws IOException {
|
||||
if (!_img.equalsIgnoreCase("image.png")) {
|
||||
@ -146,8 +162,8 @@ public class DemoApplication {
|
||||
String song = Controller.getSongTitle(img);
|
||||
|
||||
|
||||
song = (song.equalsIgnoreCase("PIANOGIRL"))?"PIANO*GIRL":(song.equalsIgnoreCase("16 -out of the gravity-"))?"1/6 -out of the gravity-":song;
|
||||
_song = (_song.equalsIgnoreCase("PIANOGIRL"))?"PIANO*GIRL":(_song.equalsIgnoreCase("16 -out of the gravity-"))?"1/6 -out of the gravity-":_song;
|
||||
song = getCorrectSongName(song);
|
||||
_song = getCorrectSongName(_song);
|
||||
|
||||
Assert.isTrue(song.equalsIgnoreCase(_song),"Expected song name to be "+_song+", got "+song);
|
||||
Assert.isTrue(r.cool == _cool,"Expected cool count to be "+_cool+", got "+r.cool);
|
||||
|
@ -9,7 +9,7 @@ public class SongData {
|
||||
public SongData(String parseStr) {
|
||||
String[] split = parseStr.split(":");
|
||||
song = split[0];
|
||||
song = (song.equalsIgnoreCase("PIANOGIRL"))?"PIANO*GIRL":(song.equalsIgnoreCase("16 -out of the gravity-"))?"1/6 -out of the gravity-":song;
|
||||
song = DemoApplication.getCorrectSongName(song);
|
||||
String[] colors = split[1].split(",");
|
||||
data = new Color[colors.length];
|
||||
for (int i=0;i<colors.length;i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user