diff --git a/src/index.tsx b/src/index.tsx index 85c95fb5b..34cf00bf2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -18,8 +18,8 @@ import { Gradient } from 'lib/rendering/gradient' import { Renderer } from 'lib/rendering/renderer' import { Themes } from 'lib/rendering/theme' import { CharacterStats } from 'lib/scoring/characterStats' -import { DataParser } from 'lib/state/dataParser' import { DB } from 'lib/state/db' +import { Metadata } from 'lib/state/metadata' import { SaveState } from 'lib/state/saveState' import { WorkerPool } from 'lib/worker/workerPool' @@ -31,7 +31,7 @@ import 'style/hsro.css' window.WorkerPool = WorkerPool window.Constants = Constants -window.DataParser = DataParser +window.DataParser = Metadata window.DB = DB window.CharacterStats = CharacterStats window.Assets = Assets @@ -50,7 +50,7 @@ window.RelicRollFixer = RelicRollFixer window.colorTheme = Themes.BLUE -DataParser.parse() +Metadata.initialize() SaveState.load(false) void verifyWebgpuSupport(false) diff --git a/src/lib/relics/tests/relicRollGrader.test.ts b/src/lib/relics/tests/relicRollGrader.test.ts index d6abe8456..5563b3ed4 100644 --- a/src/lib/relics/tests/relicRollGrader.test.ts +++ b/src/lib/relics/tests/relicRollGrader.test.ts @@ -1,11 +1,11 @@ import { Constants } from 'lib/constants/constants' import { RelicRollGrader } from 'lib/relics/relicRollGrader' -import { DataParser } from 'lib/state/dataParser' import DB from 'lib/state/db' +import { Metadata } from 'lib/state/metadata' import { Relic } from 'types/relic' import { expect, test } from 'vitest' -DataParser.parse() +Metadata.initialize() test('Test the substat values', () => { // Test that calcs for a useful mainstat and useless substats are in alignment diff --git a/src/lib/relics/tests/relicScorer.test.ts b/src/lib/relics/tests/relicScorer.test.ts index 36913c3b0..6fd80e311 100644 --- a/src/lib/relics/tests/relicScorer.test.ts +++ b/src/lib/relics/tests/relicScorer.test.ts @@ -1,12 +1,12 @@ import { Constants, PartsMainStats } from 'lib/constants/constants' import { RelicScorer } from 'lib/relics/relicScorerPotential' - -import { DataParser } from 'lib/state/dataParser' import DB from 'lib/state/db' + +import { Metadata } from 'lib/state/metadata' import { Relic } from 'types/relic' import { expect, test } from 'vitest' -DataParser.parse() +Metadata.initialize() test('relic-mainstatonly', () => { // Test that calcs for a useful mainstat and useless substats are in alignment diff --git a/src/lib/state/dataParser.ts b/src/lib/state/metadata.ts similarity index 99% rename from src/lib/state/dataParser.ts rename to src/lib/state/metadata.ts index 65d691971..2d71eee90 100644 --- a/src/lib/state/dataParser.ts +++ b/src/lib/state/metadata.ts @@ -40,8 +40,8 @@ const SPREAD_ORNAMENTS_2P_GENERAL_CONDITIONALS = [ Sets.SigoniaTheUnclaimedDesolation, ] -export const DataParser = { - parse: () => { +export const Metadata = { + initialize: () => { const lightConeSuperimpositions = getSuperimpositions() const lightConeCenters = getLightConeOverrideCenter() @@ -92,7 +92,6 @@ export const DataParser = { characters[id].imageCenter = imageCenter characters[id].displayName = getDisplayName(characters[id]) characters[id].scoringMetadata = scoringMetadata[id] - // dbMetadataCharacters[id].scoringMetadata.characterId = id } const relicSets = gameData.relics.reduce>((acc, obj) => { diff --git a/src/types/lightCone.d.ts b/src/types/lightCone.d.ts index 93f0cc583..0d7c8d4e0 100644 --- a/src/types/lightCone.d.ts +++ b/src/types/lightCone.d.ts @@ -1,4 +1,4 @@ -import { DBMetadataSuperimpositions } from 'lib/state/dataParser' +import { DBMetadataSuperimpositions } from 'lib/state/metadata' // TODO: We do a SuperImpositionLevel - 1 which requires this to be a number instead of 1 | 2 | 3... export type SuperImpositionLevel = number diff --git a/src/types/window.d.ts b/src/types/window.d.ts index ad36b5ae7..e9b2e3a18 100644 --- a/src/types/window.d.ts +++ b/src/types/window.d.ts @@ -20,8 +20,8 @@ import { Gradient } from 'lib/rendering/gradient' import { Renderer } from 'lib/rendering/renderer' import { ColorThemeOverrides } from 'lib/rendering/theme' import { CharacterStats } from 'lib/scoring/characterStats' -import { DataParser } from 'lib/state/dataParser' import { DB } from 'lib/state/db' +import { Metadata } from 'lib/state/metadata' import { SaveState } from 'lib/state/saveState' import { OptimizerTabController } from 'lib/tabs/tabOptimizer/optimizerTabController' import { Utils } from 'lib/utils/utils' @@ -68,7 +68,7 @@ declare global { yaml: unknown WorkerPool: typeof WorkerPool Constants: typeof Constants - DataParser: typeof DataParser + DataParser: typeof Metadata OptimizerTabController: typeof OptimizerTabController DB: typeof DB CharacterStats: typeof CharacterStats