feat: add double down feature to blackjack game

This commit is contained in:
Jan-Marlon Leibl 2025-03-27 15:40:26 +01:00
parent 68ea66d4f9
commit c9f71f70fa
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
7 changed files with 188 additions and 57 deletions

View file

@ -31,6 +31,13 @@ import { Card } from '../../models/blackjack.model';
>
Halten
</button>
<button
(click)="doubleDown.emit()"
class="button-primary px-8 py-4 text-lg font-medium min-w-[120px]"
[disabled]="gameState !== 'IN_PROGRESS' || playerCards.length !== 2"
>
Verdoppeln
</button>
<button
(click)="leave.emit()"
class="bg-accent-red hover:bg-accent-red/80 px-8 py-4 rounded text-lg font-medium min-w-[120px] transition-all duration-300"
@ -48,6 +55,7 @@ export class GameControlsComponent {
@Output() hit = new EventEmitter<void>();
@Output() stand = new EventEmitter<void>();
@Output() doubleDown = new EventEmitter<void>();
@Output() leave = new EventEmitter<void>();
calculateHandValue(cards: Card[]): number {