checkpoint: insanity ascends (35)

127 errors to go
This commit is contained in:
zkldi
2023-01-19 16:39:42 +00:00
parent 2b0e65f0c8
commit 5cbb2d5f8a
131 changed files with 2106 additions and 1886 deletions
@@ -1,11 +1,11 @@
import { CreatePBMergeFor } from "game-implementations/utils/pb-merge";
import { ProfileSumBestN } from "game-implementations/utils/profile-calc";
import { SessionAvgBest10For } from "game-implementations/utils/session-calc";
import { InternalFailure } from "lib/score-import/framework/common/converter-failures";
import { Volforce } from "rg-stats";
import {
FmtNum,
FmtNumCompact,
GetGrade,
GetGradeDeltas,
IIDXLIKE_GBOUNDARIES,
SDVXLIKE_GBOUNDARIES,
@@ -26,22 +26,6 @@ import type {
} from "game-implementations/types";
import type { GPTStrings, GradeBoundary, integer, SpecificUserGameStats } from "tachi-common";
/**
* Util for getting a games' grade for a given score.
*/
export function GetGrade<G extends string>(grades: Array<GradeBoundary<G>>, score: number): G {
// sort grades going downwards in their boundaries.
const descendingGrades = grades.slice(0).sort((a, b) => b.lowerBound - a.lowerBound);
for (const { name, lowerBound } of descendingGrades) {
if (score >= lowerBound) {
return name;
}
}
throw new InternalFailure(`Could not resolve grade for score ${score}.`);
}
export const EX_SCORE_CHECK: ChartSpecificMetricValidator<IIDXLikes> = (exScore, chart) => {
if (exScore < 0) {
return `EX Score cannot be negative. Got ${exScore}.`;