Scout live: valutazioni − / + per fondamentale e per set
Per ogni convocato un − o un + su battuta, ricezione, attacco e muro, separato per set e fuori dal punteggio (DD-053, migration m39: colonna scout_partite.valutazioni). Lo stato in corso le salva in scout_live.stato; il CSV admin ha la tabella per set. Nella pagina dello scout tolti il blocco avversario/campo, i tasti delle azioni e il tabellone del punteggio; il titolo della sezione mostra cognome e numero del giocatore. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09dba1890d
commit
51b7a10c99
16 files changed
+367
-120
No files matched your search
+33
-1
@@ -1,5 +1,11 @@
|
||||
import type { Giocatore } from "./crapp-data";
|
||||
import { azioniMeta, totaliPerGiocatore, type ScoutMatch } from "./scout-store";
|
||||
import {
|
||||
azioniMeta,
|
||||
contaValutazioni,
|
||||
fondamentali,
|
||||
totaliPerGiocatore,
|
||||
type ScoutMatch,
|
||||
} from "./scout-store";
|
||||
|
||||
/** Riga CSV con separatore ";" (Excel IT), riusata anche dall'export tesseramento. */
|
||||
export function rigaCsv(campi: Array<string | number>) {
|
||||
@@ -34,6 +40,32 @@ export function csvScoutMatch(match: ScoutMatch, rosa: Giocatore[]): string {
|
||||
if (!t) continue;
|
||||
righe.push(rigaCsv([g.numero, g.nome, g.ruolo, t.punti, t.ace, t.muri, t.errori]));
|
||||
}
|
||||
if (match.valutazioni.length > 0) {
|
||||
righe.push("");
|
||||
righe.push(
|
||||
rigaCsv([
|
||||
"Set",
|
||||
"Numero",
|
||||
"Giocatore",
|
||||
...fondamentali.flatMap((f) => [`${f.label} +`, `${f.label} -`]),
|
||||
]),
|
||||
);
|
||||
const sets = [...new Set(match.valutazioni.map((v) => v.set))].sort((x, y) => x - y);
|
||||
for (const set of sets) {
|
||||
for (const g of rosa) {
|
||||
if (!match.valutazioni.some((v) => v.set === set && v.giocatoreId === g.id)) continue;
|
||||
const c = contaValutazioni(match.valutazioni, g.id, set);
|
||||
righe.push(
|
||||
rigaCsv([
|
||||
set,
|
||||
g.numero,
|
||||
g.nome,
|
||||
...fondamentali.flatMap((f) => [c[f.id].piu, c[f.id].meno]),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
righe.push("");
|
||||
righe.push(rigaCsv(["Set", "Giocatore", "Azione"]));
|
||||
for (const a of match.azioni) {
|
||||
|
||||
Reference in new issue
Block a user