chess4js 1.0.0-beta.9 → 1.0.0-beta.9a
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 +15 -13
- package/chess4js.d.mts +4 -2
- package/chess4js.mjs +1842 -1776
- package/chess4js.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -424,6 +424,7 @@ factory.
|
|
|
424
424
|
| `white` | `Nullable<Player>` | The white player. |
|
|
425
425
|
| `black` | `Nullable<Player>` | The black player. |
|
|
426
426
|
| `outcome` | `string` | The outcome of the match, can be "1-0", "0-1", "1/2-1/2", "in game" or "suspended" |
|
|
427
|
+
| `id` | `Nullable<string>` | An id for the match |
|
|
427
428
|
|
|
428
429
|
#### Factories
|
|
429
430
|
|
|
@@ -450,16 +451,17 @@ are two types: arena and swiss instances. Both are further detailed in the examp
|
|
|
450
451
|
|
|
451
452
|
#### Properties
|
|
452
453
|
|
|
453
|
-
| Property | Type
|
|
454
|
-
|
|
455
|
-
| `impactFactor` | `number`
|
|
456
|
-
| `rangeFactor` | `number`
|
|
457
|
-
| `logisticBase` | `number`
|
|
458
|
-
| `tiebreakers` | `Array<string>`
|
|
459
|
-
| `leaderboard` | `ReadonlyArray<Player>`
|
|
460
|
-
| `completed` | `boolean`
|
|
461
|
-
| `activeMatches` | `ReadonlyArray<Match>`
|
|
462
|
-
| `finishedMatches` | `ReadonlyArray<Match>`
|
|
454
|
+
| Property | Type | Description |
|
|
455
|
+
|-------------------|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
|
456
|
+
| `impactFactor` | `number` | The K-factor that determines how much a single match affects the rating. A higher value leads to faster rating changes. Default is 32.0. |
|
|
457
|
+
| `rangeFactor` | `number` | The scale factor used to determine win probability. Default is 400.0. |
|
|
458
|
+
| `logisticBase` | `number` | The base of the exponent in the logistic function. Default is 10. |
|
|
459
|
+
| `tiebreakers` | `Array<string>` | The strategy for breaking ties in the leaderboard. |
|
|
460
|
+
| `leaderboard` | `ReadonlyArray<Player>` | Current player standings, ordered by score and tie-breakers. |
|
|
461
|
+
| `completed` | `boolean` | Whether the tournament has reached its conclusion. |
|
|
462
|
+
| `activeMatches` | `ReadonlyArray<Match>` | Current matches being played. |
|
|
463
|
+
| `finishedMatches` | `ReadonlyArray<Match>` | All concluded matches in the tournament history. |
|
|
464
|
+
| `idGenerator` | `Nullable<() => string>` | Unique ID generator for assigning identifiers to match objects. |
|
|
463
465
|
|
|
464
466
|
#### Methods
|
|
465
467
|
|
|
@@ -471,9 +473,9 @@ are two types: arena and swiss instances. Both are further detailed in the examp
|
|
|
471
473
|
|
|
472
474
|
#### Factories
|
|
473
475
|
|
|
474
|
-
| Function | Arguments
|
|
475
|
-
|
|
476
|
-
| `tournament` | `type`: `string`, `tiebreakers`: `Array<String>` default `["fidePerformance", "buchholz", "progressive", "sonnebornBerger"]`, `impactFactor`: `number` default `32`, `rangeFactor`: `number` default `400`, `logisticBase`: `number` default `10` | `Tournament` | Factory function to create a Tournament instance based on the specified type. |
|
|
476
|
+
| Function | Arguments | Return Type | Description |
|
|
477
|
+
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|-------------------------------------------------------------------------------|
|
|
478
|
+
| `tournament` | `type`: `string`, `tiebreakers`: `Array<String>` default `["fidePerformance", "buchholz", "progressive", "sonnebornBerger"]`, `impactFactor`: `number` default `32`, `rangeFactor`: `number` default `400`, `logisticBase`: `number` default `10`, `idGenerator`: `Nullable<() => string>` default `null` | `Tournament` | Factory function to create a Tournament instance based on the specified type. |
|
|
477
479
|
|
|
478
480
|
#### Examples
|
|
479
481
|
|
package/chess4js.d.mts
CHANGED
|
@@ -85,6 +85,7 @@ export declare class Match {
|
|
|
85
85
|
get black(): Nullable<Player>;
|
|
86
86
|
get outcome(): string;
|
|
87
87
|
set outcome(value: string);
|
|
88
|
+
get id(): Nullable<string>;
|
|
88
89
|
toString(): string;
|
|
89
90
|
}
|
|
90
91
|
/** @deprecated $metadata$ is used for internal purposes, please don't use it in your code, because it can be removed at any moment */
|
|
@@ -393,6 +394,7 @@ export declare class Tournament {
|
|
|
393
394
|
set completed(value: boolean);
|
|
394
395
|
get activeMatches(): ReadonlyArray<Match>;
|
|
395
396
|
get finishedMatches(): ReadonlyArray<Match>;
|
|
397
|
+
get idGenerator(): Nullable<() => string>;
|
|
396
398
|
addPlayer(player: Player): void;
|
|
397
399
|
removePlayer(player: Player): void;
|
|
398
400
|
nextRound(): ReadonlyArray<Match>;
|
|
@@ -435,6 +437,6 @@ export declare function customGame(gameMode: string, threeRepetitionsMode: strin
|
|
|
435
437
|
export declare function parseGames(pgnInput: string, idSupplier?: () => Nullable<any>): ReadonlyArray<Game>;
|
|
436
438
|
export declare function scoreOf(score: string): Score;
|
|
437
439
|
export declare function playerOf(name: string, initialElo: number): Player;
|
|
438
|
-
export declare function matchOf(white: Player, black: Player, impactFactor?: number, rangeFactor?: number, logisticBase?: number): Match;
|
|
439
|
-
export declare function tournament(type: string, tiebreakers?: Array<string>, impactFactor?: number, rangeFactor?: number, logisticBase?: number): Tournament;
|
|
440
|
+
export declare function matchOf(white: Player, black: Player, impactFactor?: number, rangeFactor?: number, logisticBase?: number, id?: Nullable<string>): Match;
|
|
441
|
+
export declare function tournament(type: string, tiebreakers?: Array<string>, impactFactor?: number, rangeFactor?: number, logisticBase?: number, idGenerator?: Nullable<() => string>): Tournament;
|
|
440
442
|
export declare function visibleSquares(piece: string, square: string, position: Position): Bitboard;
|