indicate the player's role

Fixes #15.
This commit is contained in:
Branden J Brown 2024-02-04 09:59:45 -06:00
parent cc33c78305
commit 6e6aca91f6
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@
<v-progress-linear v-if="!gameOver" :model-value="timeLeft" :max="initTimeLeft" :color="moveColor"></v-progress-linear> <v-progress-linear v-if="!gameOver" :model-value="timeLeft" :max="initTimeLeft" :color="moveColor"></v-progress-linear>
<v-row class="d-flex justify-center"> <v-row class="d-flex justify-center">
<v-col cols="auto"> <v-col cols="auto">
<GameStatus :game="props.game" /> <GameStatus :game="props.game" :dealer="props.dealer" />
</v-col> </v-col>
</v-row> </v-row>
<v-row> <v-row>

View File

@ -25,6 +25,7 @@ import type { Game } from '@/lib/game';
export interface Props { export interface Props {
game: Game; game: Game;
dealer: boolean;
} }
const props = defineProps<Props>(); const props = defineProps<Props>();
@ -36,7 +37,7 @@ const roundChips = computed(() => [
] as const); ] as const);
const actionMessages: Record<Game["action"], (game: Game) => string> = { const actionMessages: Record<Game["action"], (game: Game) => string> = {
Start: () => "THE MATCH BEGINS", Start: () => props.dealer ? "YOU ARE THE DEALER" : "YOU ARE THE CHALLENGER",
Shoot: (game) => game.previous ? "THE PAIN..." : "A BLANK CLATTERS ON THE TABLE", Shoot: (game) => game.previous ? "THE PAIN..." : "A BLANK CLATTERS ON THE TABLE",
GameEnd: () => "THE DEALER RELOADS THE SHOTGUN", GameEnd: () => "THE DEALER RELOADS THE SHOTGUN",
BeerGameEnd: () => "THE LAST SHELL CLATTERS ON THE TABLE", BeerGameEnd: () => "THE LAST SHELL CLATTERS ON THE TABLE",