Fix sport squadra su partite basket e ruoli organico per board.
Le partite ereditano lo sport_key della squadra alla creazione invece del default pallavolo; l'organico mostra ruoli per board (basket, volley, timed) e il wizard Android usa lo sport del team per overlay e icona. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
25
backend/app/domain/sports/player_roles.rb
Normal file
25
backend/app/domain/sports/player_roles.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user