valtech-components 4.0.410 → 4.0.412

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.
@@ -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,6 +1,6 @@
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';
3
+ import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBotProfile, ChessimalsBotProfileId, ChessimalsBoardSize, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
4
4
  import { RangeInputMetadata } from '../../molecules/range-input/types';
5
5
  import { ToggleInputMetadata } from '../../molecules/toggle-input/types';
6
6
  import { UserAvatarMetadata } from '../../atoms/user-avatar/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;
@@ -110,6 +114,9 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
110
114
  readonly hasReplayControls: import("@angular/core").Signal<boolean>;
111
115
  readonly reviewGame: import("@angular/core").Signal<ChessimalsGameState>;
112
116
  readonly currentPlayer: import("@angular/core").Signal<import("./types").ChessimalsPlayerState>;
117
+ readonly powerPlayerColor: import("@angular/core").Signal<ChessimalsPlayerColor>;
118
+ readonly powerPlayer: import("@angular/core").Signal<import("./types").ChessimalsPlayerState>;
119
+ readonly canUsePowerCards: import("@angular/core").Signal<boolean>;
113
120
  readonly legalMoves: import("@angular/core").Signal<ChessimalsMove[]>;
114
121
  readonly legalMoveKeys: import("@angular/core").Signal<Set<string>>;
115
122
  readonly captureMoveKeys: import("@angular/core").Signal<Set<string>>;
@@ -122,6 +129,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
122
129
  readonly canPlayCurrentTurn: import("@angular/core").Signal<boolean>;
123
130
  readonly canControlCurrentGame: import("@angular/core").Signal<boolean>;
124
131
  readonly rematchState: import("@angular/core").Signal<ChessimalsRematchState>;
132
+ readonly rematchActionLabel: import("@angular/core").Signal<string>;
125
133
  readonly currentTurnTitle: import("@angular/core").Signal<string>;
126
134
  readonly winTitle: import("@angular/core").Signal<string>;
127
135
  readonly winBody: import("@angular/core").Signal<string>;
@@ -193,6 +201,12 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
193
201
  showRankLabel(col: number): boolean;
194
202
  showFileLabel(row: number): boolean;
195
203
  playerLabel(color: ChessimalsPlayerColor): string;
204
+ winnerDisplayName(): string;
205
+ winnerSideLabel(): string;
206
+ winnerInitials(): string;
207
+ isCurrentPlayerVictory(): boolean;
208
+ isCurrentPlayerDefeat(): boolean;
209
+ private playerDisplayName;
196
210
  modeChipLabel(): string;
197
211
  turnTitle(): string;
198
212
  normalizeGameId(value: string): string;
@@ -217,7 +231,10 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
217
231
  unlockedLabel(color: ChessimalsPlayerColor): string;
218
232
  localModeLabel(mode: ChessimalsLocalMode): string;
219
233
  localModeDescription(mode: ChessimalsLocalMode): string;
234
+ selectBotDifficulty(difficulty: ChessimalsBotDifficulty): void;
220
235
  botDifficultyLabel(difficulty: ChessimalsBotDifficulty): string;
236
+ botProfileLabel(profile: ChessimalsBotProfile): string;
237
+ botProfileDescription(profile: ChessimalsBotProfile): string;
221
238
  animalLabel(type: ChessimalsAnimalType): string;
222
239
  canReviewPrevious(): boolean;
223
240
  canReviewNext(): boolean;
@@ -228,6 +245,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
228
245
  private displayRowIndex;
229
246
  private displayColIndex;
230
247
  private watchOnlineGame;
248
+ private applyOnlineGameSnapshot;
231
249
  private miniGamesBaseRoute;
232
250
  private chessimalsGameRoute;
233
251
  private capitalize;
@@ -18,7 +18,7 @@ export declare class ChessimalsOnlineService {
18
18
  rejectGuest(gameId: string): Promise<void>;
19
19
  move(gameId: string, move: ChessimalsMove): Promise<void>;
20
20
  resign(gameId: string): Promise<void>;
21
- requestRematch(gameId: string): Promise<void>;
21
+ requestRematch(gameId: string): Promise<ChessimalsGameState | undefined>;
22
22
  participantSide(state: ChessimalsGameState, uid?: string): ChessimalsPlayerColor | undefined;
23
23
  isParticipant(state: ChessimalsGameState, uid?: string): boolean;
24
24
  isHostWaiting(state: ChessimalsGameState, uid?: string): 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
@@ -2,4 +2,4 @@
2
2
  * Current version of valtech-components.
3
3
  * This is automatically updated during the publish process.
4
4
  */
5
- export declare const VERSION = "4.0.410";
5
+ export declare const VERSION = "4.0.412";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "4.0.410",
3
+ "version": "4.0.412",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "valtech-firebase-config": "./src/lib/services/firebase/scripts/generate-sw-config.js"