import type { DualScreenCombatState } from '../dualScreen'

export function buildCombatDualScreenState(state: DualScreenCombatState): DualScreenCombatState {
  return state
}

export function buildPvpRoguelikeDualScreenState({
  status,
  ...state
}: Omit<DualScreenCombatState, 'status'> & {
  status: DualScreenCombatState['status'] | 'queueing' | 'round-countdown'
}): DualScreenCombatState {
  return {
    ...state,
    status: status === 'queueing' || status === 'round-countdown' ? 'playing' : status,
  }
}

export function buildStadiumDualScreenState({
  status,
  ...state
}: Omit<DualScreenCombatState, 'status' | 'targetGroup' | 'speedMultiplier'> & {
  status: DualScreenCombatState['status'] | 'queueing' | 'round-countdown' | 'shop'
}): DualScreenCombatState {
  return {
    ...state,
    status: status === 'queueing' || status === 'round-countdown'
      ? 'playing'
      : status === 'shop'
        ? 'upgrade-choice'
        : status,
    targetGroup: 0,
    speedMultiplier: 1,
  }
}
