chess4js 1.0.0-beta.9f → 1.0.0-beta.9g

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.
package/README.md CHANGED
@@ -412,6 +412,22 @@ const foo = playerOf("foo", 1600);
412
412
  const bar = playerOf("bar", 1600);
413
413
  ```
414
414
 
415
+ ### Tiebreakers
416
+
417
+ This is a class for defining tournament tie-breaking strategies.
418
+
419
+ #### Methods
420
+
421
+ | Method | Arguments | Return type | Description |
422
+ |------------|------------------|-------------|--------------------------------------------------------------|
423
+ | `getValue` | player: `Player` | `Score` | alculates the specific tie-breaker value for a given player. |
424
+
425
+ #### Factories
426
+
427
+ | Function | Arguments | Return Type | Description |
428
+ |----------------|------------------|--------------|-----------------------------------------------------------------------------------|
429
+ | `tiebreakerOf` | `name`: `string` | `Tiebreaker` | Factory function that maps a string identifier to a concrete Tiebreaker instance. |
430
+
415
431
  ### Match
416
432
 
417
433
  The `Match` class represents a match between two players. It can't be directly instantiated, you need to use a
@@ -470,11 +486,11 @@ are two types: arena and swiss instances. Both are further detailed in the examp
470
486
 
471
487
  #### Methods
472
488
 
473
- | Method | Arguments | Return Type | Description |
474
- |----------------|-------------------------------------------------------------------------------------------------------------------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
475
- | `addPlayer` | `player`: `Player` | None | Adds a player to the tournament. Player's name most be unique. |
476
- | `removePlayer` | `player`: `Player` | None | Removes a player from the tournament |
477
- | `nextRound` | None | `ReadonlyArray<Match>` | Generates a list of new pairings. |
489
+ | Method | Arguments | Return Type | Description |
490
+ |----------------|---------------------------------------------------------------------------------------------------------------------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
491
+ | `addPlayer` | `player`: `Player` | None | Adds a player to the tournament. Player's name most be unique. |
492
+ | `removePlayer` | `player`: `Player` | None | Removes a player from the tournament |
493
+ | `nextRound` | None | `ReadonlyArray<Match>` | Generates a list of new pairings. |
478
494
  | `addMatch` | `white`: string, `black`: `Nullable<string>`, `outcome`: string, `id`: `Nullable<any>`, `round`: `Nullable<number>` | `boolean` | Adds a match to the tournament for the specified round. This method is ideal for cases where external logic is being used or an instance is being reconstructed. |
479
495
 
480
496
  #### Factories
package/chess4js.mjs CHANGED
@@ -14126,7 +14126,10 @@ function tournament_0(type, tiebreakers, impactFactor, rangeFactor, logisticBase
14126
14126
  timeControl = timeControl === VOID ? null : timeControl;
14127
14127
  timeControlType = timeControlType === VOID ? null : timeControlType;
14128
14128
  _init_properties_factory_kt__5kmpyw_0();
14129
- return new Tournament(tournament(type, new EloCalculator(impactFactor, rangeFactor, logisticBase), tiebreakerComparatorOf(tiebreakers.slice()), idGenerator, id, name, timeControl, timeControlType));
14129
+ // Inline function 'kotlin.apply' call
14130
+ var this_0 = new Tournament(tournament(type, new EloCalculator(impactFactor, rangeFactor, logisticBase), tiebreakerComparatorOf(tiebreakers.slice()), idGenerator, id, name, timeControl, timeControlType));
14131
+ this_0.o12(tiebreakers);
14132
+ return this_0;
14130
14133
  }
14131
14134
  function analysisGame$lambda_0() {
14132
14135
  _init_properties_factory_kt__5kmpyw_0();