fix: iidx stuff for real probably

This commit is contained in:
zkldi
2023-03-02 00:31:21 +00:00
parent ddc8738e61
commit 7d84de1ec0
3 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ const BASE_IMPL: GPTClientImplementation<GPTStrings["bms" | "pms"]> = {
// i don't know if this is correct
// it's just really hard to work out.
return Math.floor(v).toFixed(0);
return Math.round(v).toFixed(0);
}}
/>
<BMSOrPMSLampCell score={sc} />
+1 -1
View File
@@ -106,7 +106,7 @@ const IIDXCoreCells: GPTClientImplementation<GPTStrings["iidx"]>["scoreCoreCells
// i don't know if this is correct
// it's just really hard to work out.
return Math.floor(v).toFixed(0);
return Math.round(v).toFixed(0);
}}
/>
<IIDXLampCell sc={sc} chart={chart} />
@@ -2,7 +2,7 @@ import { IIDX_DP_IMPL, IIDX_SP_IMPL } from "./iidx";
import db from "external/mongo/db";
import CreateLogCtx from "lib/logger/logger";
import { CreatePBDoc } from "lib/score-import/framework/pb/create-pb-doc";
import { IIDX_GRADES, IIDX_LAMPS } from "tachi-common";
import { GetGrade, IIDXLIKE_GBOUNDARIES, IIDX_GRADES, IIDX_LAMPS } from "tachi-common";
import t from "tap";
import { dmf, mkFakePBIIDXSP, mkFakeScoreIIDXSP } from "test-utils/misc";
import ResetDBState from "test-utils/resets";
@@ -360,6 +360,19 @@ t.test("IIDX Implementation", (t) => {
IIDX_LAMPS.HARD_CLEAR,
"HARD CLEAR"
);
f(
"grade",
{ score: 1899, percent: (100 * 1899) / 1918, grade: "MAX-" },
IIDX_GRADES.MAX,
"MAX-19"
);
f(
"grade",
{ score: 2831, percent: (100 * 2831) / 3546, grade: "AA" },
IIDX_GRADES.AA,
"AA+73"
);
t.end();
});