All files / skin-beatoraja/src/scene clear-lamp.ts

100% Statements 2/2
50% Branches 1/2
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26      52x                                       595x    
import type { ClearLamp } from '@be-music/player-engine/ruleset';
import { BEATORAJA_OP } from '../runtime-ids.ts';
 
const LAMP_OPS: Readonly<Record<ClearLamp, number>> = {
  NO_PLAY: BEATORAJA_OP.CLEAR_LAMP_NOPLAY,
  FAILED: BEATORAJA_OP.CLEAR_LAMP_FAILED,
  ASSIST_EASY: BEATORAJA_OP.CLEAR_LAMP_ASSIST_EASY,
  LIGHT_ASSIST_EASY: BEATORAJA_OP.CLEAR_LAMP_LIGHT_ASSIST_EASY,
  EASY: BEATORAJA_OP.CLEAR_LAMP_EASY,
  NORMAL: BEATORAJA_OP.CLEAR_LAMP_NORMAL,
  HARD: BEATORAJA_OP.CLEAR_LAMP_HARD,
  EX_HARD: BEATORAJA_OP.CLEAR_LAMP_EXHARD,
  FULL_COMBO: BEATORAJA_OP.CLEAR_LAMP_FULLCOMBO,
  PERFECT: BEATORAJA_OP.CLEAR_LAMP_PERFECT,
  MAX: BEATORAJA_OP.CLEAR_LAMP_MAX,
};
 
/**
 * The beatoraja skin op (`BEATORAJA_OP.CLEAR_LAMP_*`) that shows `lamp`. The lamp itself comes from `resolveClearLamp`
 * (`@be-music/player-engine/ruleset`), the one clear-lamp rule every family uses (the LR2 / default result, the records and
 * the beatoraja result and select), so a play gets the same lamp whichever skin shows it.
 */
export function beatorajaClearLampOp(lamp: ClearLamp): number {
  return LAMP_OPS[lamp] ?? BEATORAJA_OP.CLEAR_LAMP_NOPLAY;
}