Skip to content

Commit

Permalink
refactor: rename metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
fribbels committed Nov 10, 2024
1 parent eebc369 commit 37f4c5a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -50,7 +50,7 @@ window.RelicRollFixer = RelicRollFixer

window.colorTheme = Themes.BLUE

DataParser.parse()
Metadata.initialize()
SaveState.load(false)
void verifyWebgpuSupport(false)

Expand Down
4 changes: 2 additions & 2 deletions src/lib/relics/tests/relicRollGrader.test.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/lib/relics/tests/relicScorer.test.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/lib/state/dataParser.ts → src/lib/state/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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<Record<string, DBMetadataSets>>((acc, obj) => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/lightCone.d.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/types/window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 37f4c5a

Please sign in to comment.