chess4js 1.0.0-beta.9d → 1.0.0-beta.9e
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 -22
- package/chess4js.d.mts +4 -4
- package/chess4js.mjs.map +1 -1
- package/kotlin-kotlin-stdlib.mjs +11 -11
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -424,14 +424,14 @@ 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<
|
|
427
|
+
| `id` | `Nullable<any>` | A unique id for the match |
|
|
428
428
|
| `round` | `Nullable<number>` | The round number (0-based) for the match or null if not applicable |
|
|
429
429
|
|
|
430
430
|
#### Factories
|
|
431
431
|
|
|
432
|
-
| Function | Arguments
|
|
433
|
-
|
|
434
|
-
| `matchOf` | `white`: `Player`, `black`: `Player`, `impactFactor`: `number` default `32`, `rangeFactor`: `number` default `400`, `logisticBase`: `number` default `10`, `id`: `Nullable<
|
|
432
|
+
| Function | Arguments | Return type | Description |
|
|
433
|
+
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------|
|
|
434
|
+
| `matchOf` | `white`: `Player`, `black`: `Player`, `impactFactor`: `number` default `32`, `rangeFactor`: `number` default `400`, `logisticBase`: `number` default `10`, `id`: `Nullable<any>` default `null`, `round`: `Nullable<number>` default `null` | `Match` | Creates a match between two players with the given elo calculation parameters or with default values. |
|
|
435
435
|
|
|
436
436
|
#### Example
|
|
437
437
|
|
|
@@ -452,21 +452,21 @@ are two types: arena and swiss instances. Both are further detailed in the examp
|
|
|
452
452
|
|
|
453
453
|
#### Properties
|
|
454
454
|
|
|
455
|
-
| Property | Type
|
|
456
|
-
|
|
457
|
-
| `impactFactor` | `number`
|
|
458
|
-
| `rangeFactor` | `number`
|
|
459
|
-
| `logisticBase` | `number`
|
|
460
|
-
| `tiebreakers` | `Array<string>`
|
|
461
|
-
| `leaderboard` | `ReadonlyArray<Player>`
|
|
462
|
-
| `completed` | `boolean`
|
|
463
|
-
| `activeMatches` | `ReadonlyArray<Match>`
|
|
464
|
-
| `finishedMatches` | `ReadonlyArray<Match>`
|
|
465
|
-
| `idGenerator` | `Nullable<() =>
|
|
466
|
-
| `id` | `Nullable<Any>`
|
|
467
|
-
| `name` | `Nullable<string>`
|
|
468
|
-
| `timeControl` | `Nullable<string>`
|
|
469
|
-
| `type` | `Nullable<string>`
|
|
455
|
+
| Property | Type | Description |
|
|
456
|
+
|-------------------|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
|
|
457
|
+
| `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. |
|
|
458
|
+
| `rangeFactor` | `number` | The scale factor used to determine win probability. Default is 400.0. |
|
|
459
|
+
| `logisticBase` | `number` | The base of the exponent in the logistic function. Default is 10. |
|
|
460
|
+
| `tiebreakers` | `Array<string>` | The strategy for breaking ties in the leaderboard. |
|
|
461
|
+
| `leaderboard` | `ReadonlyArray<Player>` | Current player standings, ordered by score and tie-breakers. |
|
|
462
|
+
| `completed` | `boolean` | Whether the tournament has reached its conclusion. |
|
|
463
|
+
| `activeMatches` | `ReadonlyArray<Match>` | Current matches being played. |
|
|
464
|
+
| `finishedMatches` | `ReadonlyArray<Match>` | All concluded matches in the tournament history. |
|
|
465
|
+
| `idGenerator` | `Nullable<() => any>` | Unique ID generator for assigning identifiers to match objects. |
|
|
466
|
+
| `id` | `Nullable<Any>` | The unique identifier for this tournament. |
|
|
467
|
+
| `name` | `Nullable<string>` | The display name of the tournament. |
|
|
468
|
+
| `timeControl` | `Nullable<string>` | The specific time settings for the matches (e.g., "3+2", "10 + 0"). |
|
|
469
|
+
| `type` | `Nullable<string>` | The category of the tournament based on the time control (e.g., "blitz", "bullet", "rapid"). |
|
|
470
470
|
|
|
471
471
|
#### Methods
|
|
472
472
|
|
|
@@ -479,9 +479,9 @@ are two types: arena and swiss instances. Both are further detailed in the examp
|
|
|
479
479
|
|
|
480
480
|
#### Factories
|
|
481
481
|
|
|
482
|
-
| Function | Arguments
|
|
483
|
-
|
|
484
|
-
| `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<() =>
|
|
482
|
+
| Function | Arguments | Return Type | Description |
|
|
483
|
+
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|-------------------------------------------------------------------------------|
|
|
484
|
+
| `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<() => any>` default `null`, `id`: `Nullable<any>` default `null`, `name`: `Nullable<string>` default `null`, `timeControl`: `Nullable<string>` default `null`, `timeControlType`: `Nullable<string>` default `null` | `Tournament` | Factory function to create a Tournament instance based on the specified type. |
|
|
485
485
|
|
|
486
486
|
#### Examples
|
|
487
487
|
|
package/chess4js.d.mts
CHANGED
|
@@ -85,7 +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<
|
|
88
|
+
get id(): Nullable<any>;
|
|
89
89
|
get round(): Nullable<number>;
|
|
90
90
|
toString(): string;
|
|
91
91
|
}
|
|
@@ -399,7 +399,7 @@ export declare class Tournament {
|
|
|
399
399
|
get type(): Nullable<string>;
|
|
400
400
|
get activeMatches(): ReadonlyArray<Match>;
|
|
401
401
|
get finishedMatches(): ReadonlyArray<Match>;
|
|
402
|
-
get idGenerator(): Nullable<() =>
|
|
402
|
+
get idGenerator(): Nullable<() => any>;
|
|
403
403
|
addPlayer(player: Player): void;
|
|
404
404
|
removePlayer(player: Player): void;
|
|
405
405
|
nextRound(): ReadonlyArray<Match>;
|
|
@@ -443,6 +443,6 @@ export declare function customGame(gameMode: string, threeRepetitionsMode: strin
|
|
|
443
443
|
export declare function parseGames(pgnInput: string, idSupplier?: () => Nullable<any>): ReadonlyArray<Game>;
|
|
444
444
|
export declare function scoreOf(score: string): Score;
|
|
445
445
|
export declare function playerOf(name: string, initialElo: number): Player;
|
|
446
|
-
export declare function matchOf(white: Player, black: Player, impactFactor?: number, rangeFactor?: number, logisticBase?: number, id?: Nullable<
|
|
447
|
-
export declare function tournament(type: string, tiebreakers?: Array<string>, impactFactor?: number, rangeFactor?: number, logisticBase?: number, idGenerator?: Nullable<() =>
|
|
446
|
+
export declare function matchOf(white: Player, black: Player, impactFactor?: number, rangeFactor?: number, logisticBase?: number, id?: Nullable<any>, round?: Nullable<number>): Match;
|
|
447
|
+
export declare function tournament(type: string, tiebreakers?: Array<string>, impactFactor?: number, rangeFactor?: number, logisticBase?: number, idGenerator?: Nullable<() => any>, id?: Nullable<string>, name?: Nullable<string>, timeControl?: Nullable<string>, timeControlType?: Nullable<string>): Tournament;
|
|
448
448
|
export declare function visibleSquares(piece: string, square: string, position: Position): Bitboard;
|