fix: size of pieces and removed text view of the game state

This commit is contained in:
shahdlala66
2026-04-17 23:30:44 +02:00
parent c11c1d4dce
commit c60d00f9d2
5 changed files with 15 additions and 71 deletions
-21
View File
@@ -19,7 +19,6 @@ export class GameComponent implements OnInit, OnDestroy {
game: GameFull | null = null;
errorMessage = '';
moveInput = '';
legalMoves: LegalMove[] = [];
loading = true;
selectedSquare: string | null = null;
highlightedSquares: string[] = [];
@@ -38,10 +37,6 @@ export class GameComponent implements OnInit, OnDestroy {
return this.game?.state ?? null;
}
get legalMoveUciList(): string[] {
return this.legalMoves.map((move) => move.uci);
}
ngOnInit(): void {
this.routeSubscription = this.route.paramMap.subscribe((paramMap) => {
const id = paramMap.get('gameId');
@@ -110,7 +105,6 @@ export class GameComponent implements OnInit, OnDestroy {
}
this.moveInput = '';
this.clearSelection();
this.loadLegalMoves();
},
error: (error: { error?: { message?: string } }) => {
this.errorMessage = error.error?.message ?? 'Move rejected.';
@@ -129,7 +123,6 @@ export class GameComponent implements OnInit, OnDestroy {
next: (game) => {
this.game = game;
this.loading = false;
this.loadLegalMoves();
this.startStream();
this.startPolling();
},
@@ -140,17 +133,6 @@ export class GameComponent implements OnInit, OnDestroy {
});
}
private loadLegalMoves(): void {
this.gameApi.getLegalMoves(this.gameId).subscribe({
next: (response) => {
this.legalMoves = response.moves;
},
error: () => {
this.legalMoves = [];
}
});
}
private startStream(): void {
this.streamSubscription = this.gameApi.streamGame(this.gameId).subscribe({
next: (event) => this.applyStreamEvent(event),
@@ -172,7 +154,6 @@ export class GameComponent implements OnInit, OnDestroy {
this.game = game;
if (previousMoves !== game.state.moves.join(',')) {
this.clearSelection();
this.loadLegalMoves();
}
}
});
@@ -182,7 +163,6 @@ export class GameComponent implements OnInit, OnDestroy {
if (event.type === 'gameFull') {
this.game = event.game;
this.clearSelection();
this.loadLegalMoves();
return;
}
@@ -192,7 +172,6 @@ export class GameComponent implements OnInit, OnDestroy {
if (event.state.moves.length !== moveCountBefore) {
this.clearSelection();
}
this.loadLegalMoves();
return;
}