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,26 @@
module Scoring
class Engine
ENGINES = {
"volley" => Engines::VolleyEngine,
"racket" => Engines::RacketEngine,
"generic" => Engines::GenericEngine,
"basket" => Engines::BasketEngine,
"timed" => Engines::TimedEngine,
"timer" => Engines::TimerEngine
}.freeze
def self.for(match)
board = match.effective_board_type
klass = ENGINES.fetch(board) { Engines::GenericEngine }
klass.new(match: match)
end
def self.for_session(session)
for(session.match)
end
def self.ensure_score_for(session)
for(session.match).ensure_score(session)
end
end
end