feat(blackjack): refresh user balance on game state change
This commit is contained in:
parent
08b12d238e
commit
e983b21e07
7 changed files with 48 additions and 19 deletions
|
@ -86,7 +86,7 @@ export class GameResultComponent {
|
|||
visible = false;
|
||||
|
||||
get isWin(): boolean {
|
||||
return this.gameState === GameState.PLAYER_WON;
|
||||
return this.gameState === GameState.PLAYER_WON || this.gameState === GameState.PLAYER_BLACKJACK;
|
||||
}
|
||||
|
||||
get isLoss(): boolean {
|
||||
|
@ -98,6 +98,7 @@ export class GameResultComponent {
|
|||
}
|
||||
|
||||
getResultTitle(): string {
|
||||
if (this.gameState === GameState.PLAYER_BLACKJACK) return 'Blackjack!';
|
||||
if (this.isWin) return 'Gewonnen!';
|
||||
if (this.isLoss) return 'Verloren!';
|
||||
if (this.isDraw) return 'Unentschieden!';
|
||||
|
@ -105,6 +106,7 @@ export class GameResultComponent {
|
|||
}
|
||||
|
||||
getResultMessage(): string {
|
||||
if (this.gameState === GameState.PLAYER_BLACKJACK) return 'Glückwunsch! Du hast mit einem Blackjack gewonnen!';
|
||||
if (this.isWin) return 'Glückwunsch! Du hast diese Runde gewonnen.';
|
||||
if (this.isLoss) return 'Schade! Du hast diese Runde verloren.';
|
||||
if (this.isDraw) return 'Diese Runde endet unentschieden. Dein Einsatz wurde zurückgegeben.';
|
||||
|
@ -112,6 +114,7 @@ export class GameResultComponent {
|
|||
}
|
||||
|
||||
getResultClass(): string {
|
||||
if (this.gameState === GameState.PLAYER_BLACKJACK) return 'text-emerald font-bold';
|
||||
if (this.isWin) return 'text-emerald';
|
||||
if (this.isLoss) return 'text-accent-red';
|
||||
if (this.isDraw) return 'text-yellow-400';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue