chess4js 1.0.0-beta.9e → 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 +22 -6
- package/chess4js.d.mts +1 -1
- package/chess4js.mjs +4 -1
- package/chess4js.mjs.map +1 -1
- package/kotlin-kotlin-stdlib.mjs +16 -16
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/package.json +1 -1
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,12 +486,12 @@ are two types: arena and swiss instances. Both are further detailed in the examp
|
|
|
470
486
|
|
|
471
487
|
#### Methods
|
|
472
488
|
|
|
473
|
-
| Method | Arguments
|
|
474
|
-
|
|
475
|
-
| `addPlayer` | `player`: `Player`
|
|
476
|
-
| `removePlayer` | `player`: `Player`
|
|
477
|
-
| `nextRound` | None
|
|
478
|
-
| `addMatch` | `white`: string, `black`: `Nullable<string>`, `outcome`: string, `id`: `Nullable<
|
|
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. |
|
|
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
|
|
481
497
|
|
package/chess4js.d.mts
CHANGED
|
@@ -403,7 +403,7 @@ export declare class Tournament {
|
|
|
403
403
|
addPlayer(player: Player): void;
|
|
404
404
|
removePlayer(player: Player): void;
|
|
405
405
|
nextRound(): ReadonlyArray<Match>;
|
|
406
|
-
addMatch(white: string, black: Nullable<string>, outcome: string, id: Nullable<
|
|
406
|
+
addMatch(white: string, black: Nullable<string>, outcome: string, id: Nullable<any>, round: Nullable<number>): boolean;
|
|
407
407
|
}
|
|
408
408
|
/** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
|
|
409
409
|
export declare namespace Tournament.$metadata$ {
|
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
|
-
|
|
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();
|