Files
healer-man/src/game/characterStatRuleset.ts

16 lines
519 B
TypeScript

import { isRomClassId, type ClassId } from "../app/characterCatalog";
export type CharacterStatRuleset = "wow" | "rom";
export function isCharacterStatRuleset(value: unknown): value is CharacterStatRuleset {
return value === "wow" || value === "rom";
}
/** Missing or invalid saved/runtime values keep the historical WoW behavior. */
export function normalizeCharacterStatRuleset(
value: unknown,
classId: ClassId,
): CharacterStatRuleset {
return value === "rom" && isRomClassId(classId) ? "rom" : "wow";
}