Popn ranking system implemented (#3)
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
f1dd7dff87
commit
1a3dcc5713
@ -59,6 +59,6 @@ public class ArcadeReader {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static void retrieveData(Path img) {
|
public static void retrieveData(Path img) {
|
||||||
new DDRReader().interpretBoxes(img);
|
new PopnReader().interpretBoxes(img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import readers.fonts.Glyph;
|
|||||||
public class PopnReader extends Reader{
|
public class PopnReader extends Reader{
|
||||||
List<Box> extraRegions = new ArrayList<>();
|
List<Box> extraRegions = new ArrayList<>();
|
||||||
static int lastJump=0;
|
static int lastJump=0;
|
||||||
|
boolean failed=false;
|
||||||
public PopnReader(){
|
public PopnReader(){
|
||||||
addRegion(new Box(941,609,275,54),NUMBER); //score[0]
|
addRegion(new Box(941,609,275,54),NUMBER); //score[0]
|
||||||
addRegion(new Box(1060,684,157,40),NUMBER); //cool[1]
|
addRegion(new Box(1060,684,157,40),NUMBER); //cool[1]
|
||||||
@ -153,6 +154,15 @@ public class PopnReader extends Reader{
|
|||||||
subRegion.setRGB(0,0,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
|
subRegion.setRGB(0,0,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
|
||||||
ImageIO.write(subRegion,"png",new File("sub.png"));
|
ImageIO.write(subRegion,"png",new File("sub.png"));
|
||||||
cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
|
cutImg.setRGB(0,currentHeight,readRegions.get(i).w,readRegions.get(i).h,arr,0,readRegions.get(i).w);
|
||||||
|
|
||||||
|
if (i==9) {
|
||||||
|
Color col = new Color(subRegion.getRGB(365,5),true);
|
||||||
|
ColorRange range = new ColorRange(230,255,70,90,80,105);
|
||||||
|
if (!range.colorInRange(col)) {
|
||||||
|
failed=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String val = interpretImage(subRegion,i);
|
String val = interpretImage(subRegion,i);
|
||||||
sig_data[counter++]=val;
|
sig_data[counter++]=val;
|
||||||
currentHeight+=readRegions.get(i).h+REGION_PADDING;
|
currentHeight+=readRegions.get(i).h+REGION_PADDING;
|
||||||
@ -230,6 +240,20 @@ public class PopnReader extends Reader{
|
|||||||
case 7:{
|
case 7:{
|
||||||
title=convertToString(splitter);
|
title=convertToString(splitter);
|
||||||
}break;
|
}break;
|
||||||
|
case 9:{
|
||||||
|
other="{failed:"+failed+"}";
|
||||||
|
if (score>=98000) {rank=0;/*S*/} else
|
||||||
|
if (score>=95000) {rank=1;/*AAA*/} else
|
||||||
|
if (score>=90000) {rank=2;/*AA*/} else
|
||||||
|
if (score>=82000) {rank=3;/*A*/} else
|
||||||
|
if (score>=72000) {rank=4;/*B*/} else
|
||||||
|
if (score>=62000) {rank=5;/*C*/} else
|
||||||
|
if (score>=50000) {rank=6;/*D*/} else
|
||||||
|
{rank=7;/*E*/}
|
||||||
|
if (failed) {
|
||||||
|
rank=Math.max(rank,5);/*F*/
|
||||||
|
}
|
||||||
|
}break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println(this);
|
System.out.println(this);
|
||||||
|
@ -83,7 +83,9 @@ public abstract class Reader{
|
|||||||
System.out.println(" belongs to region "+j+".");
|
System.out.println(" belongs to region "+j+".");
|
||||||
finalData[j]=finalData[j]+"\n"+en_data[i+8]
|
finalData[j]=finalData[j]+"\n"+en_data[i+8]
|
||||||
.substring(1,en_data[i+8].length()-1); //The beginning and endings have a ', so we remove it.
|
.substring(1,en_data[i+8].length()-1); //The beginning and endings have a ', so we remove it.
|
||||||
accuracy[j]=Double.parseDouble(en_data[i+9]);
|
if (Double.parseDouble(en_data[i+9])>accuracy[j]) {
|
||||||
|
accuracy[j]=Double.parseDouble(en_data[i+9]);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
spacing+=readRegions.get(j).h+REGION_PADDING;
|
spacing+=readRegions.get(j).h+REGION_PADDING;
|
||||||
|
BIN
result.png
BIN
result.png
Binary file not shown.
Before ![]() (image error) Size: 159 KiB After ![]() (image error) Size: 187 KiB ![]() ![]() |
@ -116,7 +116,7 @@ public class sigPlace {
|
|||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}*/
|
}*/
|
||||||
ArcadeReader.retrieveData(Paths.get("ddr10.png"));
|
ArcadeReader.retrieveData(Paths.get("popn5.png"));
|
||||||
/* Path secretFile = Paths.get(".clientsecret");
|
/* Path secretFile = Paths.get(".clientsecret");
|
||||||
List<String> data;
|
List<String> data;
|
||||||
try {
|
try {
|
||||||
|
BIN
sub.png
BIN
sub.png
Binary file not shown.
Before ![]() (image error) Size: 12 KiB After ![]() (image error) Size: 9.0 KiB ![]() ![]() |
Loading…
x
Reference in New Issue
Block a user