forked from Cookies_Github_mirror/AquaDX
[chuni] Update rating calculation
This commit is contained in:
@@ -2,6 +2,26 @@ package icu.samnyan.aqua.sega.util;
|
||||
|
||||
public class VersionUtil {
|
||||
|
||||
public static VersionInfo parseVersion(String version) {
|
||||
var vs = version.split("\\.");
|
||||
try {
|
||||
VersionInfo v = new VersionInfo();
|
||||
if (vs.length > 0) {
|
||||
v.setMajorVersion(Integer.parseInt(vs[0]));
|
||||
}
|
||||
if (vs.length > 1) {
|
||||
v.setMinorVersion(Integer.parseInt(vs[1]));
|
||||
}
|
||||
if (vs.length > 2) {
|
||||
v.setReleaseVersion(Integer.parseInt(vs[2]));
|
||||
}
|
||||
return v;
|
||||
} catch (Exception e) {
|
||||
return new VersionInfo(0, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String getTargetVersion(String savedVersion, String currentVersion) {
|
||||
var v1s = savedVersion.split("\\.");
|
||||
var v2s = currentVersion.split("\\.");
|
||||
|
||||
Reference in New Issue
Block a user