Mapped out all constants for testing (#7)

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 2 years ago
parent a6063fa21c
commit 2c3e4fbdd9
  1. 66
      ArcadeReader.java
  2. BIN
      popn1.png
  3. 5
      readers/DDRReader.java
  4. 5
      readers/ITGReader.java
  5. 4
      readers/LoveLiveReader.java
  6. 7
      readers/PopnReader.java
  7. 50
      readers/Reader.java
  8. 5
      readers/SoundVoltexReader.java
  9. 2
      sigPlace.java
  10. 0
      tests/ddr1.png
  11. 0
      tests/ddr10.png
  12. 0
      tests/ddr11.png
  13. 0
      tests/ddr2.png
  14. 0
      tests/ddr3.png
  15. 0
      tests/ddr4.png
  16. 0
      tests/ddr5.png
  17. 0
      tests/ddr6.png
  18. 0
      tests/ddr7.png
  19. 0
      tests/ddr8.png
  20. 0
      tests/ddr9.png
  21. 0
      tests/debug
  22. 0
      tests/itg1.png
  23. 0
      tests/itg10.png
  24. 0
      tests/itg11.png
  25. 0
      tests/itg12.png
  26. 0
      tests/itg13.png
  27. 0
      tests/itg14.png
  28. 0
      tests/itg15.png
  29. 0
      tests/itg2.png
  30. 0
      tests/itg3.png
  31. 0
      tests/itg4.png
  32. 0
      tests/itg5.png
  33. 0
      tests/itg6.png
  34. 0
      tests/itg7.png
  35. 0
      tests/itg8.png
  36. 0
      tests/itg9.png
  37. 0
      tests/lovelive1.png
  38. 0
      tests/lovelive10.png
  39. 0
      tests/lovelive11.png
  40. 0
      tests/lovelive12.png
  41. 0
      tests/lovelive2.png
  42. 0
      tests/lovelive3.png
  43. 0
      tests/lovelive4.png
  44. 0
      tests/lovelive5.png
  45. 0
      tests/lovelive6.png
  46. 0
      tests/lovelive7.png
  47. 0
      tests/lovelive8.png
  48. 0
      tests/lovelive9.png
  49. 0
      tests/popn1.png
  50. 0
      tests/popn10.png
  51. 0
      tests/popn11.png
  52. 0
      tests/popn12.png
  53. 0
      tests/popn13.png
  54. 0
      tests/popn14.png
  55. 0
      tests/popn15.png
  56. 0
      tests/popn2.png
  57. 0
      tests/popn3.png
  58. 0
      tests/popn4.png
  59. 0
      tests/popn5.png
  60. 0
      tests/popn6.png
  61. 0
      tests/popn7.png
  62. 0
      tests/popn8.png
  63. 0
      tests/popn9.png
  64. 0
      tests/sdvx1.png
  65. 0
      tests/sdvx2.png
  66. 0
      tests/sdvx3.png
  67. 0
      tests/sdvx4.png
  68. 0
      tests/sdvx5.png
  69. 0
      tests/sdvx6.png
  70. 0
      tests/sdvx7.png

@ -4,6 +4,7 @@ import readers.DDRReader;
import readers.ITGReader;
import readers.LoveLiveReader;
import readers.PopnReader;
import readers.Reader;
import readers.SoundVoltexReader;
public class ArcadeReader {
@ -58,7 +59,68 @@ public class ArcadeReader {
* - Not going to support right now.
*
*/
public static void retrieveData(Path img) {
new LoveLiveReader().interpretBoxes(img);
final int DDR_AAA=0;
final int DDR_AAPLUS=1;
final int DDR_AA=2;
final int DDR_AAMINUS=3;
final int DDR_APLUS=4;
final int DDR_A=5;
final int DDR_AMINUS=6;
final int DDR_BPLUS=7;
final int DDR_B=8;
final int DDR_BMINUS=9;
final int DDR_CPLUS=10;
final int DDR_C=11;
final int DDR_CMINUS=12;
final int DDR_DPLUS=13;
final int DDR_D=14;
final int ITG_QUAD=0;
final int ITG_TRI=1;
final int ITG_DOUB=2;
final int ITG_STAR=3;
final int ITG_SPLUS=4;
final int ITG_S=5;
final int ITG_SMINUS=6;
final int ITG_APLUS=7;
final int ITG_A=8;
final int ITG_AMINUS=9;
final int ITG_BPLUS=10;
final int ITG_B=11;
final int ITG_BMINUS=12;
final int ITG_CPLUS=13;
final int ITG_C=14;
final int ITG_CMINUS=15;
final int ITG_D=16;
final int LOVELIVE_SSS=0;
final int LOVELIVE_SS=1;
final int LOVELIVE_S=2;
final int LOVELIVE_A=3;
final int LOVELIVE_B=4;
final int LOVELIVE_C=5;
final int LOVELIVE_D=6;
final int POPN_S=0;
final int POPN_AAA=1;
final int POPN_AA=2;
final int POPN_A=3;
final int POPN_B=4;
final int POPN_C=5;
final int POPN_D=6;
final int POPN_E=7;
final int SDVX_S=0;
final int SDVX_AAAPLUS=1;
final int SDVX_AAA=2;
final int SDVX_AAPLUS=3;
final int SDVX_AA=4;
final int SDVX_APLUS=5;
final int SDVX_A=6;
final int SDVX_B=7;
final int SDVX_C=8;
final int SDVX_D=9;
public static void runTests() {
test("ddr1.png",DDRReader.class,
994790/*score*/,
0/*rank*/);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

@ -228,8 +228,7 @@ public class DDRReader extends Reader{
return "";
}
@Override
void interpretResults(String[] finalData) {
String interpretResults(String[] finalData) {
for (int i=0;i<finalData.length;i++) {
String[] splitter = finalData[i].split(Pattern.quote("\n"));
switch (i) {
@ -300,6 +299,6 @@ public class DDRReader extends Reader{
}break;
}
}
System.out.println(this);
return toString();
}
}

@ -186,8 +186,7 @@ public class ITGReader extends Reader{
return "";
}
@Override
void interpretResults(String[] finalData) {
String interpretResults(String[] finalData) {
for (int i=0;i<finalData.length;i++) {
String[] splitter = finalData[i].split(Pattern.quote("\n"));
switch (i) {
@ -251,6 +250,6 @@ public class ITGReader extends Reader{
}break;
}
}
System.out.println(this);
return toString();
}
}

@ -320,7 +320,7 @@ public class LoveLiveReader extends Reader{
return "";
}
void interpretResults(String[] finalData) {
String interpretResults(String[] finalData) {
for (int i=0;i<finalData.length;i++) {
String[] splitter = finalData[i].split(Pattern.quote("\n"));
switch (i) {
@ -361,7 +361,7 @@ public class LoveLiveReader extends Reader{
}break;
}
}
System.out.println(this);
return toString();
}
int getDifficulty(String str) {

@ -211,8 +211,7 @@ public class PopnReader extends Reader{
return "";
}
@Override
void interpretResults(String[] finalData) {
String interpretResults(String[] finalData) {
for (int i=0;i<finalData.length;i++) {
String[] splitter = finalData[i].split(Pattern.quote("\n"));
switch (i) {
@ -251,11 +250,11 @@ public class PopnReader extends Reader{
if (score>=50000) {rank=6;/*D*/} else
{rank=7;/*E*/}
if (failed) {
rank=Math.max(rank,5);/*F*/
rank=Math.max(rank,3);/*F*/
}
}break;
}
}
System.out.println(this);
return toString();
}
}

@ -146,10 +146,9 @@ public abstract class Reader{
}
}
System.out.println(Arrays.toString(finalData));
interpretResults(finalData);
return null;
return interpretResults(finalData);
};
abstract void interpretResults(String[] finalData);
abstract String interpretResults(String[] finalData);
void trimAllData(String[] data) {
StringBuilder sb = new StringBuilder();
for (int i=0;i<data.length;i++) {
@ -333,4 +332,49 @@ public abstract class Reader{
+ ", other=" + other + ", pct=" + pct + ", rank=" + rank + ", score=" + score + ", title=" + title
+ "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + difficulty;
result = prime * result + maxcombo;
result = prime * result + Arrays.hashCode(notes);
result = prime * result + Arrays.deepHashCode(number_alternatives);
result = prime * result + ((other == null) ? 0 : other.hashCode());
long temp;
temp = Double.doubleToLongBits(pct);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + rank;
result = prime * result + score;
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Reader other = (Reader) obj;
if (difficulty != other.difficulty)
return false;
if (maxcombo != other.maxcombo)
return false;
if (!Arrays.equals(notes, other.notes))
return false;
if (this.other == null) {
if (other.other != null)
return false;
} else if (!this.other.equals(other.other))
return false;
if (Double.doubleToLongBits(pct) != Double.doubleToLongBits(other.pct))
return false;
if (rank != other.rank)
return false;
if (score != other.score)
return false;
return true;
}
}

@ -406,8 +406,7 @@ public class SoundVoltexReader extends Reader{
return "";
}
@Override
void interpretResults(String[] finalData) {
String interpretResults(String[] finalData) {
for (int i=0;i<finalData.length;i++) {
String[] splitter = finalData[i].split(Pattern.quote("\n"));
switch (i) {
@ -496,6 +495,6 @@ public class SoundVoltexReader extends Reader{
}break;
}
}
System.out.println(this);
return toString();
}
}

@ -116,7 +116,7 @@ public class sigPlace {
// TODO Auto-generated catch block
e.printStackTrace();
}*/
ArcadeReader.retrieveData(Paths.get("lovelive8.png"));
ArcadeReader.runTests();
/* Path secretFile = Paths.get(".clientsecret");
List<String> data;
try {

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 3.5 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.6 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before

Width:  |  Height:  |  Size: 1000 KiB

After

Width:  |  Height:  |  Size: 1000 KiB

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before

Width:  |  Height:  |  Size: 967 KiB

After

Width:  |  Height:  |  Size: 967 KiB

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Before

Width:  |  Height:  |  Size: 983 KiB

After

Width:  |  Height:  |  Size: 983 KiB

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before

Width:  |  Height:  |  Size: 1016 KiB

After

Width:  |  Height:  |  Size: 1016 KiB

Before

Width:  |  Height:  |  Size: 996 KiB

After

Width:  |  Height:  |  Size: 996 KiB

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Loading…
Cancel
Save