# frozen_string_literal: true module Sports class PlayerRoles BY_BOARD = { "volley" => %w[Schiacciatore Opposto Centrale Palleggiatore Libero Universale], "basket" => ["Playmaker", "Guardia", "Ala", "Ala forte", "Centro"], "racket" => %w[Giocatore], "timed" => %w[Portiere Difensore Centrocampista Attaccante], "generic" => %w[Giocatore], "timer" => %w[Giocatore] }.freeze class << self def for_team(team) board = team.effective_board_type BY_BOARD[board] || BY_BOARD["generic"] end def for_board(board) BY_BOARD[board.to_s] || BY_BOARD["generic"] end end end end