feat: new tourment and add bot
This commit is contained in:
@@ -4,7 +4,7 @@ import { ActivatedRoute, RouterLink } from '@angular/router';
|
||||
import { BoardActionsBarComponent } from '../../components/board-actions-bar/board-actions-bar.component';
|
||||
import { ChessBoardComponent } from '../../components/chess-board/chess-board.component';
|
||||
import { ExportPanelComponent } from '../../components/export-panel/export-panel.component';
|
||||
import { MoveHistoryComponent, MoveNavDirection } from '../../components/move-history/move-history.component';
|
||||
import { MoveHistoryComponent } from '../../components/move-history/move-history.component';
|
||||
import { PlayerCardComponent } from '../../components/player-card/player-card.component';
|
||||
import { PromotionDialogComponent } from '../../components/promotion-dialog/promotion-dialog.component';
|
||||
import { GameFacade } from './game.facade';
|
||||
@@ -158,12 +158,7 @@ export class GameComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
onResign(): void {
|
||||
this.showToast('Resigned');
|
||||
}
|
||||
|
||||
// ── Move history navigation ───────────────────────────────────
|
||||
onMoveNavigate(_direction: MoveNavDirection): void {
|
||||
// Visual-only for now; board always reflects live position.
|
||||
this.facade.requestResign();
|
||||
}
|
||||
|
||||
// ── Timer helpers ─────────────────────────────────────────────
|
||||
@@ -199,6 +194,11 @@ export class GameComponent implements OnInit, OnDestroy {
|
||||
this.blackTimerMs = clock.blackRemainingMs < 0
|
||||
? -1
|
||||
: Math.max(0, clock.blackRemainingMs - (!activeIsWhite ? elapsed : 0));
|
||||
|
||||
if ((this.whiteTimerMs !== null && this.whiteTimerMs <= 0 && clock.whiteRemainingMs > 0) ||
|
||||
(this.blackTimerMs !== null && this.blackTimerMs <= 0 && clock.blackRemainingMs > 0)) {
|
||||
this.facade.errorMessage = '';
|
||||
}
|
||||
}
|
||||
|
||||
private showToast(msg: string): void {
|
||||
|
||||
Reference in New Issue
Block a user