valtech-components 4.0.404 → 4.0.405
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/esm2022/lib/components/organisms/mini-games/chessimals-engine.mjs +80 -8
- package/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +145 -17
- package/esm2022/lib/components/organisms/mini-games/chessimals-online.service.mjs +7 -7
- package/esm2022/lib/components/organisms/mini-games/mini-games.i18n.mjs +11 -1
- package/esm2022/lib/components/organisms/mini-games/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +240 -30
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-engine.d.ts +2 -1
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +12 -0
- package/lib/components/organisms/mini-games/types.d.ts +10 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameMode, ChessimalsGameState, ChessimalsGameStatus, ChessimalsMove, ChessimalsOnlineState, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
1
|
+
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameMode, ChessimalsGameState, ChessimalsGameStatus, ChessimalsMove, ChessimalsMoveHistoryEntry, ChessimalsOnlineState, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
2
2
|
export interface CreateChessimalsGameOptions {
|
|
3
3
|
id?: string;
|
|
4
4
|
mode?: ChessimalsGameMode;
|
|
@@ -11,5 +11,6 @@ export declare function getChessimalsLegalMoves(state: ChessimalsGameState, piec
|
|
|
11
11
|
export declare function getChessimalsAllLegalMoves(state: ChessimalsGameState, color?: ChessimalsPlayerColor): ChessimalsMove[];
|
|
12
12
|
export declare function chooseChessimalsBotMove(state: ChessimalsGameState, difficulty?: ChessimalsBotDifficulty): ChessimalsMove | undefined;
|
|
13
13
|
export declare function applyChessimalsMove(state: ChessimalsGameState, candidate: ChessimalsMove): ChessimalsGameState;
|
|
14
|
+
export declare function createChessimalsReviewState(state: ChessimalsGameState, entry: ChessimalsMoveHistoryEntry): ChessimalsGameState;
|
|
14
15
|
export declare function resignChessimalsGame(state: ChessimalsGameState, color: ChessimalsPlayerColor): ChessimalsGameState;
|
|
15
16
|
export declare function positionKey(position: ChessimalsPosition): string;
|
|
@@ -83,6 +83,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
83
83
|
readonly resumeSplashVisible: import("@angular/core").WritableSignal<boolean>;
|
|
84
84
|
readonly rematchLoading: import("@angular/core").WritableSignal<boolean>;
|
|
85
85
|
readonly moveSyncing: import("@angular/core").WritableSignal<boolean>;
|
|
86
|
+
readonly reviewIndex: import("@angular/core").WritableSignal<number>;
|
|
86
87
|
readonly loggedInUser: import("@angular/core").Signal<import("valtech-components").AuthUser>;
|
|
87
88
|
readonly localPlayerProfile: import("@angular/core").Signal<import("./types").MiniGamePlayerProfile>;
|
|
88
89
|
readonly localPlayerAvatar: import("@angular/core").Signal<string>;
|
|
@@ -92,6 +93,10 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
92
93
|
set onlineGameId(value: string | null | undefined);
|
|
93
94
|
miniGamesRoute: string;
|
|
94
95
|
projectionMode: boolean;
|
|
96
|
+
readonly replayEntries: import("@angular/core").Signal<import("./types").ChessimalsMoveHistoryEntry[]>;
|
|
97
|
+
readonly activeReviewIndex: import("@angular/core").Signal<number>;
|
|
98
|
+
readonly hasReplayControls: import("@angular/core").Signal<boolean>;
|
|
99
|
+
readonly reviewGame: import("@angular/core").Signal<ChessimalsGameState>;
|
|
95
100
|
readonly currentPlayer: import("@angular/core").Signal<import("./types").ChessimalsPlayerState>;
|
|
96
101
|
readonly legalMoves: import("@angular/core").Signal<ChessimalsMove[]>;
|
|
97
102
|
readonly legalMoveKeys: import("@angular/core").Signal<Set<string>>;
|
|
@@ -147,6 +152,8 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
147
152
|
private shouldKeepBoardOrientationStatic;
|
|
148
153
|
private focusBoardSoon;
|
|
149
154
|
private playMoveSound;
|
|
155
|
+
private clearReview;
|
|
156
|
+
private showLatestReviewSnapshot;
|
|
150
157
|
private queueMoveEffect;
|
|
151
158
|
toggleAnimal(animal: ChessimalsAnimalView): void;
|
|
152
159
|
pieceAt(row: number, col: number): ChessimalsPiece | undefined;
|
|
@@ -190,6 +197,11 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
190
197
|
localModeDescription(mode: ChessimalsLocalMode): string;
|
|
191
198
|
botDifficultyLabel(difficulty: ChessimalsBotDifficulty): string;
|
|
192
199
|
animalLabel(type: ChessimalsAnimalType): string;
|
|
200
|
+
canReviewPrevious(): boolean;
|
|
201
|
+
canReviewNext(): boolean;
|
|
202
|
+
reviewPreviousMove(): void;
|
|
203
|
+
reviewNextMove(): void;
|
|
204
|
+
replayPositionLabel(): string;
|
|
193
205
|
private displayRowIndex;
|
|
194
206
|
private displayColIndex;
|
|
195
207
|
private watchOnlineGame;
|
|
@@ -69,6 +69,15 @@ export interface ChessimalsMove {
|
|
|
69
69
|
animal?: ChessimalsAnimalType;
|
|
70
70
|
capturesPieceId?: string;
|
|
71
71
|
}
|
|
72
|
+
export interface ChessimalsMoveHistoryEntry {
|
|
73
|
+
moveNumber: number;
|
|
74
|
+
pieces: ChessimalsPiece[];
|
|
75
|
+
currentTurn: ChessimalsPlayerColor;
|
|
76
|
+
status: ChessimalsGameStatus;
|
|
77
|
+
move?: ChessimalsMove;
|
|
78
|
+
winner?: ChessimalsPlayerColor;
|
|
79
|
+
winnerReason?: ChessimalsWinReason;
|
|
80
|
+
}
|
|
72
81
|
export type ChessimalsMoveLogStatus = 'accepted' | 'rejected';
|
|
73
82
|
export interface ChessimalsMoveLogEntry {
|
|
74
83
|
id: string;
|
|
@@ -146,5 +155,6 @@ export interface ChessimalsGameState {
|
|
|
146
155
|
winnerReason?: ChessimalsWinReason;
|
|
147
156
|
moveCount: number;
|
|
148
157
|
lastMove?: ChessimalsMove;
|
|
158
|
+
moveHistory?: ChessimalsMoveHistoryEntry[];
|
|
149
159
|
online?: ChessimalsOnlineState;
|
|
150
160
|
}
|
package/lib/version.d.ts
CHANGED