jl-sprt-core 1.1.8 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,35 @@ import { A_Result } from './A_Result';
3
3
  import { A_TeamRoster } from '../A_TeamRoster';
4
4
  import type { MatchContext, MatchContextProvider } from './A_Serie';
5
5
  /**
6
- * Clase abstracta que define el contrato de la simulación de un partido.
7
- * Cada deporte debe implementar su propia lógica de simulación.
6
+ * Fase del partido dentro del ciclo de simulación.
7
+ * - 'regular' : tiempo reglamentario.
8
+ * - 'tiebreak' : fase de desempate (penales, golden set, overtime...).
9
+ * - 'finished' : el partido terminó.
10
+ */
11
+ export type MatchPlayPhase = 'regular' | 'tiebreak' | 'finished';
12
+ /**
13
+ * Clase abstracta que define el ciclo de vida de la simulación de un partido.
14
+ *
15
+ * Implementa como **template method** el flujo común a todos los deportes:
16
+ *
17
+ * tiempo regular
18
+ * → ¿el partido puede cerrar la serie y sigue empatado?
19
+ * sí → fase de desempate (hasta resolverla)
20
+ * no → fin (empate permitido, o ya hay ganador)
21
+ *
22
+ * Cada deporte aporta SÓLO lo específico mediante los hooks:
23
+ * - `startPlay(one, two)` inicialización propia del deporte.
24
+ * - `playRegularInterval()` juega un intervalo del tiempo reglamentario.
25
+ * - `regularTimeIsOver()` ¿terminó el tiempo reglamentario?
26
+ * - `playTieBreakInterval()` juega un intervalo de la fase de desempate.
27
+ * - `tieBreakIsResolved()` ¿la fase de desempate ya definió un ganador?
28
+ * - `hasTieBreak()` (opcional) ¿el deporte tiene fase de desempate? (default true)
29
+ *
30
+ * La decisión de "debe seguir para desempatar" NO reimplementa la regla de la
31
+ * serie: consulta el contexto (`canDecideSerie()` / `isSerieDecidedWith()`), que
32
+ * calcula `A_Serie`.
8
33
  *
9
- * MS: number para futbol/basketball, IVolleyballScore para volleyball, etc.
34
+ * MS: tipo del score del partido. TR: roster del deporte.
10
35
  */
11
36
  export declare abstract class A_MatchPlay<MS extends TMatchScore, TR extends A_TeamRoster> {
12
37
  protected _time: number;
@@ -14,11 +39,43 @@ export declare abstract class A_MatchPlay<MS extends TMatchScore, TR extends A_T
14
39
  protected _teamOne: TR | undefined;
15
40
  protected _teamTwo: TR | undefined;
16
41
  protected _contextProvider?: MatchContextProvider<MS>;
42
+ protected _phase: MatchPlayPhase;
17
43
  constructor(contextProvider?: MatchContextProvider<MS>);
18
44
  get time(): number;
19
- abstract get isFinished(): boolean;
45
+ get phase(): MatchPlayPhase;
20
46
  get result(): A_Result<MS> | undefined;
21
47
  get context(): MatchContext<MS> | undefined;
22
- abstract start(one: TR, two: TR): void;
23
- abstract advance(): void;
48
+ /** El partido terminó cuando alcanzó la fase 'finished'. */
49
+ get isFinished(): boolean;
50
+ /** Inicia el partido. Los deportes NO sobreescriben esto; usan `startPlay`. */
51
+ start(one: TR, two: TR): void;
52
+ /**
53
+ * Avanza un intervalo de simulación. Coordina las fases; los deportes definen
54
+ * qué ocurre dentro de cada fase vía los hooks.
55
+ */
56
+ advance(): void;
57
+ private advanceRegular;
58
+ private closeRegularOrEnterTieBreak;
59
+ private advanceTieBreak;
60
+ /**
61
+ * ¿El partido debe jugar una fase de desempate?
62
+ *
63
+ * Sólo si pertenece a una serie que este partido puede cerrar y, con el
64
+ * marcador actual, la serie todavía no quedó definida. Sin serie
65
+ * (`context === undefined`), no hay desempate: el partido puede terminar
66
+ * empatado si el deporte lo permite.
67
+ */
68
+ protected mustPlayTieBreak(): boolean;
69
+ /** Inicialización específica del deporte (crear el Result, resetear flags). */
70
+ protected abstract startPlay(one: TR, two: TR): void;
71
+ /** Juega un intervalo del tiempo reglamentario (anotaciones del deporte). */
72
+ protected abstract playRegularInterval(): void;
73
+ /** ¿Terminó el tiempo reglamentario? */
74
+ protected abstract regularTimeIsOver(): boolean;
75
+ /** Juega un intervalo de la fase de desempate (penales / golden set / overtime). */
76
+ protected abstract playTieBreakInterval(): void;
77
+ /** ¿La fase de desempate ya definió un ganador? */
78
+ protected abstract tieBreakIsResolved(): boolean;
79
+ /** ¿El deporte tiene fase de desempate? Por defecto sí. */
80
+ protected hasTieBreak(): boolean;
24
81
  }
@@ -2,23 +2,114 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.A_MatchPlay = void 0;
4
4
  /**
5
- * Clase abstracta que define el contrato de la simulación de un partido.
6
- * Cada deporte debe implementar su propia lógica de simulación.
5
+ * Clase abstracta que define el ciclo de vida de la simulación de un partido.
7
6
  *
8
- * MS: number para futbol/basketball, IVolleyballScore para volleyball, etc.
7
+ * Implementa como **template method** el flujo común a todos los deportes:
8
+ *
9
+ * tiempo regular
10
+ * → ¿el partido puede cerrar la serie y sigue empatado?
11
+ * sí → fase de desempate (hasta resolverla)
12
+ * no → fin (empate permitido, o ya hay ganador)
13
+ *
14
+ * Cada deporte aporta SÓLO lo específico mediante los hooks:
15
+ * - `startPlay(one, two)` inicialización propia del deporte.
16
+ * - `playRegularInterval()` juega un intervalo del tiempo reglamentario.
17
+ * - `regularTimeIsOver()` ¿terminó el tiempo reglamentario?
18
+ * - `playTieBreakInterval()` juega un intervalo de la fase de desempate.
19
+ * - `tieBreakIsResolved()` ¿la fase de desempate ya definió un ganador?
20
+ * - `hasTieBreak()` (opcional) ¿el deporte tiene fase de desempate? (default true)
21
+ *
22
+ * La decisión de "debe seguir para desempatar" NO reimplementa la regla de la
23
+ * serie: consulta el contexto (`canDecideSerie()` / `isSerieDecidedWith()`), que
24
+ * calcula `A_Serie`.
25
+ *
26
+ * MS: tipo del score del partido. TR: roster del deporte.
9
27
  */
10
28
  class A_MatchPlay {
11
29
  constructor(contextProvider) {
30
+ this._phase = 'regular';
12
31
  this._time = -1;
13
32
  this._contextProvider = contextProvider;
14
33
  }
15
34
  get time() { return this._time; }
35
+ get phase() { return this._phase; }
16
36
  get result() { return this._result; }
17
37
  get context() {
18
- if (this._contextProvider) {
19
- return this._contextProvider();
38
+ return this._contextProvider ? this._contextProvider() : undefined;
39
+ }
40
+ /** El partido terminó cuando alcanzó la fase 'finished'. */
41
+ get isFinished() { return this._phase === 'finished'; }
42
+ // -------------------------------------------------------------------------
43
+ // Ciclo de vida (template method).
44
+ // -------------------------------------------------------------------------
45
+ /** Inicia el partido. Los deportes NO sobreescriben esto; usan `startPlay`. */
46
+ start(one, two) {
47
+ this._teamOne = one;
48
+ this._teamTwo = two;
49
+ this._time = 0;
50
+ this._phase = 'regular';
51
+ this.startPlay(one, two);
52
+ }
53
+ /**
54
+ * Avanza un intervalo de simulación. Coordina las fases; los deportes definen
55
+ * qué ocurre dentro de cada fase vía los hooks.
56
+ */
57
+ advance() {
58
+ if (!this._result || !this._teamOne || !this._teamTwo) {
59
+ throw new Error('No se inició el match');
60
+ }
61
+ if (this._phase === 'finished')
62
+ return;
63
+ if (this._phase === 'regular') {
64
+ this.advanceRegular();
65
+ return;
66
+ }
67
+ // this._phase === 'tiebreak'
68
+ this.advanceTieBreak();
69
+ }
70
+ advanceRegular() {
71
+ if (this.regularTimeIsOver()) {
72
+ this.closeRegularOrEnterTieBreak();
73
+ return;
74
+ }
75
+ this.playRegularInterval();
76
+ // Un intervalo puede haber agotado el tiempo reglamentario.
77
+ if (this.regularTimeIsOver()) {
78
+ this.closeRegularOrEnterTieBreak();
79
+ }
80
+ }
81
+ closeRegularOrEnterTieBreak() {
82
+ if (this.hasTieBreak() && this.mustPlayTieBreak()) {
83
+ this._phase = 'tiebreak';
20
84
  }
85
+ else {
86
+ this._phase = 'finished';
87
+ }
88
+ }
89
+ advanceTieBreak() {
90
+ this.playTieBreakInterval();
91
+ if (this.tieBreakIsResolved()) {
92
+ this._phase = 'finished';
93
+ }
94
+ }
95
+ /**
96
+ * ¿El partido debe jugar una fase de desempate?
97
+ *
98
+ * Sólo si pertenece a una serie que este partido puede cerrar y, con el
99
+ * marcador actual, la serie todavía no quedó definida. Sin serie
100
+ * (`context === undefined`), no hay desempate: el partido puede terminar
101
+ * empatado si el deporte lo permite.
102
+ */
103
+ mustPlayTieBreak() {
104
+ const ctx = this.context;
105
+ if (!ctx)
106
+ return false;
107
+ if (!ctx.canDecideSerie())
108
+ return false;
109
+ return !ctx.isSerieDecidedWith(this._result);
21
110
  }
111
+ /** ¿El deporte tiene fase de desempate? Por defecto sí. */
112
+ hasTieBreak() { return true; }
22
113
  }
23
114
  exports.A_MatchPlay = A_MatchPlay;
24
115
  //# sourceMappingURL=A_MatchPlay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"A_MatchPlay.js","sourceRoot":"","sources":["../../src/Match/A_MatchPlay.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACH,MAAsB,WAAW;IAOhC,YAAY,eAA0C;QACrD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,IAAI,IAAI,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAGzC,IAAI,MAAM,KAA+B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,IAAI,OAAO;QACV,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAChC,CAAC;IACF,CAAC;CAID;AAxBD,kCAwBC"}
1
+ {"version":3,"file":"A_MatchPlay.js","sourceRoot":"","sources":["../../src/Match/A_MatchPlay.ts"],"names":[],"mappings":";;;AAaA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAsB,WAAW;IAShC,YAAY,eAA0C;QAF5C,WAAM,GAAmB,SAAS,CAAC;QAG5C,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,IAAI,IAAI,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,IAAI,KAAK,KAAqB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,IA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A4D;QAC5D,IAAI,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;YAC9B,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACpC,CAAC;IACF,CAAC;IAEO,2BAA2B;QAClC,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;YACnD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QAC1B,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QAC1B,CAAC;IACF,CAAC;IAEO,eAAe;QACtB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;QAC1B,CAAC;IACF,CAAC;IAED;;;;;;;OAOG;IACO,gBAAgB;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC;QACzB,IAAI,CAAC,GAAG;YAAE,OAAO,KAAK,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE;YAAE,OAAO,KAAK,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAQ,CAAC,CAAC;IAC/C,CAAC;IAqBD,2DAA2D;IACjD,WAAW,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;CACjD;AAxHD,kCAwHC"}
@@ -29,6 +29,15 @@ export declare abstract class A_Result<MS extends TMatchScore> {
29
29
  getScore(id: string): MS;
30
30
  get teamOneId(): string;
31
31
  get teamTwoId(): string;
32
+ /**
33
+ * Aporte comparable de un equipo al resultado agregado de la serie.
34
+ *
35
+ * Cada deporte define qué magnitud representa su marcador de cara a la serie
36
+ * (p. ej. goles en football, sets ganados / partidos en volleyball, puntos en
37
+ * american football). `A_Serie` compara únicamente estos valores; no conoce la
38
+ * estructura interna del score de cada deporte.
39
+ */
40
+ abstract aggregateValue(teamId: string): number;
32
41
  abstract getResultInfo(): IResultInfo<MS>;
33
42
  abstract getWinnerInfo(): IWinnerInfo;
34
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"A_Result.js","sourceRoot":"","sources":["../../src/Match/A_Result.ts"],"names":[],"mappings":";;;AAmBA;;;;;GAKG;AACH,MAAsB,QAAQ;IAQ7B,YAAY,SAAiB,EAAE,SAAiB,EAAE,UAAoB;QACrE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,IAAI,CAAC,aAAa,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC;QAC9D,IAAI,CAAC,aAAa,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC;IAC/D,CAAC;IAID,QAAQ,CAAC,EAAU;QAChB,IAAI,EAAE,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAClC,CAAC;aAAM,IAAI,EAAE,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;IAEF,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAA,CAAC,CAAC;IAC1D,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAA,CAAC,CAAC;CAI1D;AAjCD,4BAiCC"}
1
+ {"version":3,"file":"A_Result.js","sourceRoot":"","sources":["../../src/Match/A_Result.ts"],"names":[],"mappings":";;;AAmBA;;;;;GAKG;AACH,MAAsB,QAAQ;IAQ7B,YAAY,SAAiB,EAAE,SAAiB,EAAE,UAAoB;QACrE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,IAAI,CAAC,aAAa,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC;QAC9D,IAAI,CAAC,aAAa,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC;IAC/D,CAAC;IAID,QAAQ,CAAC,EAAU;QAChB,IAAI,EAAE,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAClC,CAAC;aAAM,IAAI,EAAE,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;IAEF,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAA,CAAC,CAAC;IAC1D,IAAI,SAAS,KAAa,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAA,CAAC,CAAC;CAc1D;AA3CD,4BA2CC"}
@@ -16,41 +16,45 @@ export interface ISerieCreationInfo<TR extends A_TeamRoster> {
16
16
  season: number;
17
17
  opt: TypeBaseStageOption;
18
18
  }
19
+ /**
20
+ * Vista que la serie ofrece al partido en curso.
21
+ *
22
+ * El partido NO conoce el formato de la serie (único, ida/vuelta, best-of-N...).
23
+ * Sólo puede consultar:
24
+ *
25
+ * - `previousResults`: resultados de los partidos anteriores de la serie ya
26
+ * disputados (no incluye el partido en curso). El deporte los usa para calcular
27
+ * su agregado o su desempate propio.
28
+ * - `canDecideSerie()`: ¿este partido, por su posición en la serie, puede cerrarla?
29
+ * (la ida de un h&a nunca cierra; la vuelta sí). Un partido sin serie no tiene
30
+ * contexto, así que esta pregunta sólo existe dentro de una serie.
31
+ * - `isSerieDecidedWith(currentResult)`: con el marcador actual del partido en
32
+ * curso, ¿la serie ya quedó definida? Si es `false` y el deporte tiene fase de
33
+ * desempate, el partido debe seguir jugando para intentar definir.
34
+ *
35
+ * Toda la lógica de formato vive en `A_Serie`; el contexto es sólo una vista.
36
+ */
19
37
  export type MatchContext<MS extends TMatchScore> = {
20
- /**
21
- * Resultados de los partidos de la serie que ya fueron disputados.
22
- * El partido actualmente en juego no está incluido.
23
- */
24
- results: A_Result<MS>[];
25
- /**
26
- * Cantidad total de partidos que componen la serie.
27
- * Actualmente puede ser 1 (partido único) o 2 (ida y vuelta).
28
- */
29
- totalMatches: number;
30
- /**
31
- * Cantidad de victorias necesarias para ganar la serie.
32
- * Por ejemplo, 4 en una serie al mejor de 7.
33
- *
34
- * En series de ida y vuelta este valor puede no ser suficiente
35
- * para determinar el ganador, ya que también pueden intervenir
36
- * otros criterios de desempate, como el resultado acumulado.
37
- */
38
- totalWins: number;
38
+ previousResults: A_Result<MS>[];
39
+ canDecideSerie(): boolean;
40
+ isSerieDecidedWith(currentResult: A_Result<MS>): boolean;
39
41
  };
40
42
  export type MatchContextProvider<MS extends TMatchScore> = () => MatchContext<MS>;
41
43
  /**
42
44
  * Serie genérica de partidos.
43
45
  *
44
46
  * Una serie está compuesta por uno o más partidos entre los mismos equipos.
45
- * La serie es responsable de:
47
+ * La serie es la **única** responsable de:
46
48
  *
47
49
  * - mantener los partidos que la componen;
48
- * - determinar cuándo terminó la serie;
49
- * - determinar ganador y perdedor;
50
- * - proporcionar al partido su contexto de serie.
50
+ * - determinar cuándo terminó la serie (`isFinished`);
51
+ * - determinar ganador y perdedor (`winner` / `loser`);
52
+ * - proporcionar a cada partido su contexto de serie.
51
53
  *
52
- * El resultado de la serie no se almacena separadamente:
53
- * se obtiene a partir de los resultados de los partidos.
54
+ * Los deportes NO reimplementan la resolución de la serie: aportan sólo el valor
55
+ * comparable (`A_Result.aggregateValue`) y, si su agregado se cuenta de otra forma
56
+ * (p. ej. volleyball cuenta partidos ganados y desempata con un golden set),
57
+ * sobreescriben los hooks `serieValue` / `resolveWinnerId`.
54
58
  *
55
59
  * MS: tipo del score de cada partido.
56
60
  * TR: tipo de roster utilizado por los equipos.
@@ -67,23 +71,62 @@ export declare abstract class A_Serie<MS extends TMatchScore, TR extends A_TeamR
67
71
  get teamTwo(): A_Team<TR>;
68
72
  get opt(): TypeBaseStageOption;
69
73
  get matches(): A_Match<MS, TR>[];
74
+ /** Cantidad de partidos que componen la serie (1 = único, 2 = ida/vuelta). */
75
+ get totalMatches(): number;
70
76
  getResults(): A_Result<MS>[];
71
77
  /**
72
- * Indica si todos los partidos necesarios para resolver
73
- * la serie han terminado.
78
+ * La serie terminó cuando todos sus partidos terminaron.
79
+ * (En formatos best-of-N esto se sobreescribirá: terminaría al alcanzar el
80
+ * umbral de victorias.)
81
+ */
82
+ get isFinished(): boolean;
83
+ /** Equipo ganador de la serie. Lanza si la serie todavía no terminó. */
84
+ get winner(): A_Team<TR>;
85
+ /** Equipo perdedor de la serie. Lanza si la serie todavía no terminó. */
86
+ get loser(): A_Team<TR>;
87
+ /**
88
+ * Construye el `MatchContextProvider` del partido en la posición `index`.
89
+ * El provider se evalúa cada vez que el partido consulta su contexto, de modo
90
+ * que `previousResults` refleja el estado real de la serie en ese momento.
91
+ */
92
+ protected contextProviderForMatch(index: number): MatchContextProvider<MS>;
93
+ /** Resultados de los partidos anteriores a `index` que ya terminaron. */
94
+ protected resultsBefore(index: number): A_Result<MS>[];
95
+ /**
96
+ * ¿El partido en `index` puede cerrar la serie?
97
+ * Único (1 partido): sí. Ida y vuelta: sólo la vuelta (index 1).
74
98
  */
75
- abstract get isFinished(): boolean;
99
+ protected canDecideSerie(index: number): boolean;
76
100
  /**
77
- * Equipo ganador de la serie.
101
+ * Con el marcador actual del partido en `index`, ¿la serie quedaría definida?
102
+ * Se usa para decidir si el partido debe entrar en su fase de desempate.
78
103
  *
79
- * Debe lanzar un error si la serie todavía no tiene ganador.
104
+ * Sólo tiene sentido en el último partido; en los anteriores devuelve `false`.
105
+ */
106
+ protected isSerieDecidedWith(index: number, currentResult: A_Result<MS>): boolean;
107
+ /**
108
+ * Valor agregado de un equipo en la serie, contando los resultados anteriores
109
+ * más (opcionalmente) el resultado del partido en curso.
110
+ *
111
+ * Por defecto: suma de `aggregateValue` de cada resultado (football, AF).
112
+ * Volleyball sobreescribe para contar partidos ganados + golden set.
113
+ */
114
+ protected serieValue(teamId: string, previous: A_Result<MS>[], current?: A_Result<MS>): number;
115
+ /**
116
+ * Determina el id del equipo ganador de la serie ya terminada.
117
+ * Por defecto compara `serieValue` sobre todos los resultados.
118
+ * Deportes con desempate propio (penales/golden set) lo tienen ya reflejado en
119
+ * el `Result` del último partido, por lo que `aggregateValue` debe incorporarlo.
80
120
  */
81
- abstract get winner(): A_Team<TR>;
121
+ protected resolveWinnerId(): string;
82
122
  /**
83
- * Equipo perdedor de la serie.
123
+ * Desempate final cuando el agregado quedó igualado.
84
124
  *
85
- * Debe lanzar un error si la serie todavía no tiene ganador.
125
+ * El desempate específico del deporte (penales en football, golden set en
126
+ * volleyball) ya fue jugado y quedó registrado en el `Result` del último
127
+ * partido; aquí sólo se lee. Por defecto no hay forma de desempatar (error):
128
+ * cada deporte que pueda empatar en el agregado debe sobreescribir esto.
86
129
  */
87
- abstract get loser(): A_Team<TR>;
130
+ protected breakAggregateTie(results: A_Result<MS>[]): string;
88
131
  }
89
132
  export type AnySerie = A_Serie<any, any>;
@@ -5,15 +5,17 @@ exports.A_Serie = void 0;
5
5
  * Serie genérica de partidos.
6
6
  *
7
7
  * Una serie está compuesta por uno o más partidos entre los mismos equipos.
8
- * La serie es responsable de:
8
+ * La serie es la **única** responsable de:
9
9
  *
10
10
  * - mantener los partidos que la componen;
11
- * - determinar cuándo terminó la serie;
12
- * - determinar ganador y perdedor;
13
- * - proporcionar al partido su contexto de serie.
11
+ * - determinar cuándo terminó la serie (`isFinished`);
12
+ * - determinar ganador y perdedor (`winner` / `loser`);
13
+ * - proporcionar a cada partido su contexto de serie.
14
14
  *
15
- * El resultado de la serie no se almacena separadamente:
16
- * se obtiene a partir de los resultados de los partidos.
15
+ * Los deportes NO reimplementan la resolución de la serie: aportan sólo el valor
16
+ * comparable (`A_Result.aggregateValue`) y, si su agregado se cuenta de otra forma
17
+ * (p. ej. volleyball cuenta partidos ganados y desempata con un golden set),
18
+ * sobreescriben los hooks `serieValue` / `resolveWinnerId`.
17
19
  *
18
20
  * MS: tipo del score de cada partido.
19
21
  * TR: tipo de roster utilizado por los equipos.
@@ -29,7 +31,7 @@ class A_Serie {
29
31
  matchCreator({
30
32
  id: `${info.id}-M1`, homeTeam: info.teamOne, awayTeam: info.teamTwo,
31
33
  hw: info.hws[0], season: info.season,
32
- contextProvider: isHandA ? fisrtH_ASerieMatchProvider() : UniqueMatchProvider(),
34
+ contextProvider: this.contextProviderForMatch(0),
33
35
  isNeutral: info.opt == 'neutral'
34
36
  })
35
37
  ];
@@ -37,67 +39,142 @@ class A_Serie {
37
39
  matches.push(matchCreator({
38
40
  id: `${info.id}-M2`, homeTeam: info.teamTwo, awayTeam: info.teamOne,
39
41
  hw: info.hws[1], season: info.season,
40
- contextProvider: LastH_ASerieMatchProvider(matches[0]),
42
+ contextProvider: this.contextProviderForMatch(1),
41
43
  isNeutral: false
42
44
  }));
43
45
  }
44
46
  this._matches = matches;
45
47
  }
46
- get id() {
47
- return this._id;
48
+ get id() { return this._id; }
49
+ get teamOne() { return this._teamOne; }
50
+ get teamTwo() { return this._teamTwo; }
51
+ get opt() { return this._opt; }
52
+ get matches() { return this._matches; }
53
+ /** Cantidad de partidos que componen la serie (1 = único, 2 = ida/vuelta). */
54
+ get totalMatches() { return this._matches.length; }
55
+ getResults() {
56
+ if (!this.isFinished) {
57
+ throw new Error(`Matches of series not finished`);
58
+ }
59
+ return this.matches.map((m) => m.result);
48
60
  }
49
- get teamOne() {
50
- return this._teamOne;
61
+ /**
62
+ * La serie terminó cuando todos sus partidos terminaron.
63
+ * (En formatos best-of-N esto se sobreescribirá: terminaría al alcanzar el
64
+ * umbral de victorias.)
65
+ */
66
+ get isFinished() {
67
+ return this._matches.every((m) => m.isFinished);
51
68
  }
52
- get teamTwo() {
53
- return this._teamTwo;
69
+ /** Equipo ganador de la serie. Lanza si la serie todavía no terminó. */
70
+ get winner() {
71
+ if (!this.isFinished) {
72
+ throw new Error('La serie todavía no terminó');
73
+ }
74
+ const winnerId = this.resolveWinnerId();
75
+ if (winnerId === this._teamOne.id)
76
+ return this._teamOne;
77
+ if (winnerId === this._teamTwo.id)
78
+ return this._teamTwo;
79
+ throw new Error(`La serie ${this._id} no pudo definir un ganador`);
54
80
  }
55
- get opt() {
56
- return this._opt;
81
+ /** Equipo perdedor de la serie. Lanza si la serie todavía no terminó. */
82
+ get loser() {
83
+ return this.winner.id === this._teamOne.id ? this._teamTwo : this._teamOne;
57
84
  }
58
- get matches() {
59
- return this._matches;
85
+ // -------------------------------------------------------------------------
86
+ // Contexto ofrecido a cada partido de la serie.
87
+ // -------------------------------------------------------------------------
88
+ /**
89
+ * Construye el `MatchContextProvider` del partido en la posición `index`.
90
+ * El provider se evalúa cada vez que el partido consulta su contexto, de modo
91
+ * que `previousResults` refleja el estado real de la serie en ese momento.
92
+ */
93
+ contextProviderForMatch(index) {
94
+ return () => ({
95
+ previousResults: this.resultsBefore(index),
96
+ canDecideSerie: () => this.canDecideSerie(index),
97
+ isSerieDecidedWith: (currentResult) => this.isSerieDecidedWith(index, currentResult),
98
+ });
60
99
  }
61
- getResults() {
62
- if (!this.isFinished) {
63
- throw new Error(`Matches of series not finished`);
100
+ /** Resultados de los partidos anteriores a `index` que ya terminaron. */
101
+ resultsBefore(index) {
102
+ const out = [];
103
+ for (let i = 0; i < index; i++) {
104
+ const m = this._matches[i];
105
+ if (m && m.isFinished && m.result)
106
+ out.push(m.result);
64
107
  }
65
- return this.matches.map((m) => m.result);
108
+ return out;
109
+ }
110
+ /**
111
+ * ¿El partido en `index` puede cerrar la serie?
112
+ * Único (1 partido): sí. Ida y vuelta: sólo la vuelta (index 1).
113
+ */
114
+ canDecideSerie(index) {
115
+ return index === this.totalMatches - 1;
116
+ }
117
+ /**
118
+ * Con el marcador actual del partido en `index`, ¿la serie quedaría definida?
119
+ * Se usa para decidir si el partido debe entrar en su fase de desempate.
120
+ *
121
+ * Sólo tiene sentido en el último partido; en los anteriores devuelve `false`.
122
+ */
123
+ isSerieDecidedWith(index, currentResult) {
124
+ if (!this.canDecideSerie(index))
125
+ return false;
126
+ const previous = this.resultsBefore(index);
127
+ const oneValue = this.serieValue(this._teamOne.id, previous, currentResult);
128
+ const twoValue = this.serieValue(this._teamTwo.id, previous, currentResult);
129
+ return oneValue !== twoValue;
130
+ }
131
+ // -------------------------------------------------------------------------
132
+ // Hooks de agregación (sobreescribibles por deporte).
133
+ // -------------------------------------------------------------------------
134
+ /**
135
+ * Valor agregado de un equipo en la serie, contando los resultados anteriores
136
+ * más (opcionalmente) el resultado del partido en curso.
137
+ *
138
+ * Por defecto: suma de `aggregateValue` de cada resultado (football, AF).
139
+ * Volleyball sobreescribe para contar partidos ganados + golden set.
140
+ */
141
+ serieValue(teamId, previous, current) {
142
+ let total = 0;
143
+ for (const r of previous)
144
+ total += r.aggregateValue(teamId);
145
+ if (current)
146
+ total += current.aggregateValue(teamId);
147
+ return total;
148
+ }
149
+ /**
150
+ * Determina el id del equipo ganador de la serie ya terminada.
151
+ * Por defecto compara `serieValue` sobre todos los resultados.
152
+ * Deportes con desempate propio (penales/golden set) lo tienen ya reflejado en
153
+ * el `Result` del último partido, por lo que `aggregateValue` debe incorporarlo.
154
+ */
155
+ resolveWinnerId() {
156
+ const results = this.getResults();
157
+ const oneValue = this.serieValue(this._teamOne.id, results);
158
+ const twoValue = this.serieValue(this._teamTwo.id, results);
159
+ if (oneValue > twoValue)
160
+ return this._teamOne.id;
161
+ if (twoValue > oneValue)
162
+ return this._teamTwo.id;
163
+ // Agregado empatado: el desempate propio del deporte (penales, golden set)
164
+ // quedó reflejado en el resultado del último partido.
165
+ return this.breakAggregateTie(results);
166
+ }
167
+ /**
168
+ * Desempate final cuando el agregado quedó igualado.
169
+ *
170
+ * El desempate específico del deporte (penales en football, golden set en
171
+ * volleyball) ya fue jugado y quedó registrado en el `Result` del último
172
+ * partido; aquí sólo se lee. Por defecto no hay forma de desempatar (error):
173
+ * cada deporte que pueda empatar en el agregado debe sobreescribir esto.
174
+ */
175
+ breakAggregateTie(results) {
176
+ throw new Error(`La serie ${this._id} terminó empatada y no pudo resolverse`);
66
177
  }
67
178
  }
68
179
  exports.A_Serie = A_Serie;
69
- function UniqueMatchProvider() {
70
- return () => {
71
- return {
72
- results: [],
73
- totalMatches: 1,
74
- totalWins: 0,
75
- mustProduceWinner: true
76
- };
77
- };
78
- }
79
- function fisrtH_ASerieMatchProvider() {
80
- return () => {
81
- return {
82
- results: [],
83
- totalMatches: 2,
84
- totalWins: 0,
85
- mustProduceWinner: false
86
- };
87
- };
88
- }
89
- function LastH_ASerieMatchProvider(match) {
90
- return () => {
91
- if (!match.isFinished) {
92
- throw new Error(``);
93
- }
94
- const res = match.result;
95
- return {
96
- results: [res],
97
- totalMatches: 2,
98
- totalWins: 0,
99
- mustProduceWinner: true
100
- };
101
- };
102
- }
103
180
  //# sourceMappingURL=A_Serie.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"A_Serie.js","sourceRoot":"","sources":["../../src/Match/A_Serie.ts"],"names":[],"mappings":";;;AA+CA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAsB,OAAO;IAQ5B,YAAY,IAA4B,EAAE,YAAmE;QAC5G,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,IAA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