Introduce architettura multi-sport con catalogo, engine scoring e overlay.

Catalogo sport in YAML, board implicito, engine per volley/basket/timed/racket/timer/generic, regia e app Android allineate.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-09 20:11:21 +02:00
parent 53f9a6a884
commit e727069d43
56 changed files with 1783 additions and 223 deletions

View File

@@ -0,0 +1,32 @@
module Public
module RegiaHelper
def regia_board_partial(match)
board = match.effective_board_type
partial = "public/regia/#{board}"
lookup_context.exists?(partial, [], true) ? partial : "public/regia/volley"
end
def regia_header_subtitle(match, score)
board = match.effective_board_type
case board
when "basket", "timed"
live_score_period_label(match, score)
when "timer"
"Cronometro"
when "generic"
"Punteggio"
else
"Set #{score.current_set}"
end
end
def format_clock_secs(secs, count_up: false)
total = secs.to_i
return count_up ? "0:00" : "" if total <= 0 && !count_up
m = total / 60
s = total % 60
format("%d:%02d", m, s)
end
end
end