valtech-components 4.0.411 → 4.0.413
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 +113 -20
- package/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +170 -35
- package/esm2022/lib/components/organisms/mini-games/mini-games.i18n.mjs +45 -3
- package/esm2022/lib/components/organisms/mini-games/retro-audio.service.mjs +14 -4
- package/esm2022/lib/components/organisms/mini-games/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +338 -58
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-engine.d.ts +3 -2
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +18 -2
- package/lib/components/organisms/mini-games/retro-audio.service.d.ts +2 -0
- package/lib/components/organisms/mini-games/types.d.ts +8 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameMode, ChessimalsGameState, ChessimalsGameStatus, ChessimalsMove, ChessimalsMoveHistoryEntry, ChessimalsOnlineState, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
1
|
+
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBotProfile, ChessimalsBotProfileId, ChessimalsBoardSize, ChessimalsGameMode, ChessimalsGameState, ChessimalsGameStatus, ChessimalsMove, ChessimalsMoveHistoryEntry, ChessimalsOnlineState, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
2
|
+
export declare const CHESSIMALS_BOT_PROFILES: ChessimalsBotProfile[];
|
|
2
3
|
export interface CreateChessimalsGameOptions {
|
|
3
4
|
id?: string;
|
|
4
5
|
mode?: ChessimalsGameMode;
|
|
@@ -9,7 +10,7 @@ export declare function createChessimalsGame(boardSize?: ChessimalsBoardSize, op
|
|
|
9
10
|
export declare function getChessimalsPieceAt(state: ChessimalsGameState, position: ChessimalsPosition): ChessimalsPiece | undefined;
|
|
10
11
|
export declare function getChessimalsLegalMoves(state: ChessimalsGameState, pieceId: string, animal?: ChessimalsAnimalType): ChessimalsMove[];
|
|
11
12
|
export declare function getChessimalsAllLegalMoves(state: ChessimalsGameState, color?: ChessimalsPlayerColor): ChessimalsMove[];
|
|
12
|
-
export declare function chooseChessimalsBotMove(state: ChessimalsGameState, difficulty?: ChessimalsBotDifficulty): ChessimalsMove | undefined;
|
|
13
|
+
export declare function chooseChessimalsBotMove(state: ChessimalsGameState, difficulty?: ChessimalsBotDifficulty, profileId?: ChessimalsBotProfileId): ChessimalsMove | undefined;
|
|
13
14
|
export declare function applyChessimalsMove(state: ChessimalsGameState, candidate: ChessimalsMove): ChessimalsGameState;
|
|
14
15
|
export declare function createChessimalsReviewState(state: ChessimalsGameState, entry: ChessimalsMoveHistoryEntry): ChessimalsGameState;
|
|
15
16
|
export declare function resignChessimalsGame(state: ChessimalsGameState, color: ChessimalsPlayerColor): ChessimalsGameState;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { FormControl } from '@angular/forms';
|
|
3
|
-
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
4
|
-
import { RangeInputMetadata } from '../../molecules/range-input/types';
|
|
3
|
+
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBotProfile, ChessimalsBotProfileId, ChessimalsBoardSize, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
4
|
+
import { RangeInputMetadata, RangeValue } from '../../molecules/range-input/types';
|
|
5
5
|
import { ToggleInputMetadata } from '../../molecules/toggle-input/types';
|
|
6
6
|
import { UserAvatarMetadata } from '../../atoms/user-avatar/types';
|
|
7
7
|
import { ButtonMetadata } from '../../types';
|
|
@@ -43,6 +43,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
43
43
|
private readonly auth;
|
|
44
44
|
private readonly haptics;
|
|
45
45
|
private readonly playerProfiles;
|
|
46
|
+
private readonly ngZone;
|
|
46
47
|
private boardOrientationTimer;
|
|
47
48
|
private moveAnimationTimer;
|
|
48
49
|
private botTurnTimer;
|
|
@@ -61,11 +62,13 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
61
62
|
readonly boardSizes: ChessimalsBoardSize[];
|
|
62
63
|
readonly localModes: ChessimalsLocalMode[];
|
|
63
64
|
readonly botDifficulties: ChessimalsBotDifficulty[];
|
|
65
|
+
readonly botProfiles: ChessimalsBotProfile[];
|
|
64
66
|
readonly animals: ChessimalsAnimalView[];
|
|
65
67
|
readonly screen: import("@angular/core").WritableSignal<"home" | "game">;
|
|
66
68
|
readonly selectedBoardSize: import("@angular/core").WritableSignal<ChessimalsBoardSize>;
|
|
67
69
|
readonly selectedLocalMode: import("@angular/core").WritableSignal<ChessimalsLocalMode>;
|
|
68
70
|
readonly selectedBotDifficulty: import("@angular/core").WritableSignal<ChessimalsBotDifficulty>;
|
|
71
|
+
readonly selectedBotProfileId: import("@angular/core").WritableSignal<ChessimalsBotProfileId>;
|
|
69
72
|
readonly game: import("@angular/core").WritableSignal<ChessimalsGameState>;
|
|
70
73
|
readonly selectedPieceId: import("@angular/core").WritableSignal<string>;
|
|
71
74
|
readonly selectedAnimal: import("@angular/core").WritableSignal<ChessimalsAnimalType>;
|
|
@@ -102,6 +105,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
102
105
|
readonly sfxToggleProps: import("@angular/core").Signal<ToggleInputMetadata>;
|
|
103
106
|
readonly musicVolumeProps: import("@angular/core").Signal<RangeInputMetadata>;
|
|
104
107
|
readonly sfxVolumeProps: import("@angular/core").Signal<RangeInputMetadata>;
|
|
108
|
+
readonly availableBotProfiles: import("@angular/core").Signal<ChessimalsBotProfile[]>;
|
|
105
109
|
set onlineGameId(value: string | null | undefined);
|
|
106
110
|
miniGamesRoute: string;
|
|
107
111
|
projectionMode: boolean;
|
|
@@ -141,6 +145,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
141
145
|
ngOnInit(): void;
|
|
142
146
|
protected t(key: string): string;
|
|
143
147
|
private shortUserId;
|
|
148
|
+
private rangeValueToNumber;
|
|
144
149
|
startGame(): void;
|
|
145
150
|
createOnlineGame(): Promise<void>;
|
|
146
151
|
joinOnlineGameByCode(): Promise<void>;
|
|
@@ -160,6 +165,8 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
160
165
|
closeRulesModal(): void;
|
|
161
166
|
openSettingsModal(): void;
|
|
162
167
|
closeSettingsModal(): void;
|
|
168
|
+
setMusicVolume(value: number | RangeValue): void;
|
|
169
|
+
setSfxVolume(value: number | RangeValue): void;
|
|
163
170
|
selectCell(position: ChessimalsPosition): void;
|
|
164
171
|
private animateMove;
|
|
165
172
|
private applyAnimatedMove;
|
|
@@ -197,6 +204,12 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
197
204
|
showRankLabel(col: number): boolean;
|
|
198
205
|
showFileLabel(row: number): boolean;
|
|
199
206
|
playerLabel(color: ChessimalsPlayerColor): string;
|
|
207
|
+
winnerDisplayName(): string;
|
|
208
|
+
winnerSideLabel(): string;
|
|
209
|
+
winnerInitials(): string;
|
|
210
|
+
isCurrentPlayerVictory(): boolean;
|
|
211
|
+
isCurrentPlayerDefeat(): boolean;
|
|
212
|
+
private playerDisplayName;
|
|
200
213
|
modeChipLabel(): string;
|
|
201
214
|
turnTitle(): string;
|
|
202
215
|
normalizeGameId(value: string): string;
|
|
@@ -221,7 +234,10 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
221
234
|
unlockedLabel(color: ChessimalsPlayerColor): string;
|
|
222
235
|
localModeLabel(mode: ChessimalsLocalMode): string;
|
|
223
236
|
localModeDescription(mode: ChessimalsLocalMode): string;
|
|
237
|
+
selectBotDifficulty(difficulty: ChessimalsBotDifficulty): void;
|
|
224
238
|
botDifficultyLabel(difficulty: ChessimalsBotDifficulty): string;
|
|
239
|
+
botProfileLabel(profile: ChessimalsBotProfile): string;
|
|
240
|
+
botProfileDescription(profile: ChessimalsBotProfile): string;
|
|
225
241
|
animalLabel(type: ChessimalsAnimalType): string;
|
|
226
242
|
canReviewPrevious(): boolean;
|
|
227
243
|
canReviewNext(): boolean;
|
|
@@ -41,7 +41,15 @@ export type ChessimalsWinReason = 'promotion' | 'elimination' | 'resignation';
|
|
|
41
41
|
export type ChessimalsGameMode = 'local' | 'online';
|
|
42
42
|
export type ChessimalsLocalMode = 'one-device' | 'bot';
|
|
43
43
|
export type ChessimalsBotDifficulty = 'easy' | 'normal' | 'hard';
|
|
44
|
+
export type ChessimalsBotProfileId = 'explorer' | 'impulsive' | 'runner' | 'hunter' | 'guardian' | 'jumper' | 'strategist' | 'predator' | 'sprinter' | 'sentinel';
|
|
44
45
|
export type ChessimalsGameStatus = 'waiting' | 'in_progress' | 'finished' | 'expired';
|
|
46
|
+
export interface ChessimalsBotProfile {
|
|
47
|
+
id: ChessimalsBotProfileId;
|
|
48
|
+
difficulty: ChessimalsBotDifficulty;
|
|
49
|
+
avatar: string;
|
|
50
|
+
labelKey: string;
|
|
51
|
+
descriptionKey: string;
|
|
52
|
+
}
|
|
45
53
|
export interface ChessimalsPosition {
|
|
46
54
|
row: number;
|
|
47
55
|
col: number;
|
package/lib/version.d.ts
CHANGED