Fixed bug in SMParser--> Files will be now parsed good

This commit is contained in:
jancoow
2015-06-11 11:23:06 +02:00
parent 96c584742c
commit e1160c6062
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -6,6 +6,7 @@ public class Main {
if(args.length > 0 && args[0] != null){
new SMFileSearcher(args[0]);
}else{
new SMFileSearcher("/home/janco/Documents/SMTEST");
System.out.println("No inputdir given");
}
}
+2 -2
View File
@@ -66,7 +66,7 @@ public class SMParser {
double precision = (1.0/notes.length)*1000;
double time = secondscounter*1000;
for(String note:notes){
int direction = noteToDirection(note);
int direction = noteToDirection(note.trim());
if(direction != -1){
JsonObjectBuilder object = Json.createObjectBuilder();
object.add("time", time);
@@ -74,7 +74,7 @@ public class SMParser {
object.add("button", (int)(Math.random()*maxButtons+1));
objectsArrayBuilder.add(object.build());
}
if(extraButtonTime*maxButtons < time && maxButtons+1 < difficultyToMaxButtons(difficulty)){ //add a new/extra button
if(extraButtonTime*maxButtons < time && maxButtons < difficultyToMaxButtons(difficulty)){ //add a new/extra button
buttonsArrayBuilder.add(Json.createObjectBuilder().add("time", time).add("button", maxButtons+1).add("color", maxButtons));
maxButtons++;
}