From 9a02235ebaabb844304b170f2765210648b55e40 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sat, 3 Feb 2024 12:54:19 -0600 Subject: [PATCH] only report match winners --- game/game.go | 2 +- serve/dto.go | 2 +- site/src/lib/game.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/game/game.go b/game/game.go index 4c9c2fe..fa9229c 100644 --- a/game/game.go +++ b/game/game.go @@ -240,7 +240,7 @@ func (g *Match) DTO(id player.ID) serve.Game { blank = len(g.shells) - live } w := serve.NoWinner - switch g.RoundWinner() { + switch g.MatchWinner() { case &g.players[0]: w = serve.DealerWins case &g.players[1]: diff --git a/serve/dto.go b/serve/dto.go index f544461..5c092d7 100644 --- a/serve/dto.go +++ b/serve/dto.go @@ -9,7 +9,7 @@ type Game struct { Players [2]Player `json:"players"` // Action indicates the previous action taken in the game. Action string `json:"action"` - // Winner indicates the winner of the current round, if any. + // Winner indicates the winner of the match, if any. Winner Winner `json:"winner,omitempty"` // Round is the current round. Round int8 `json:"round"` diff --git a/site/src/lib/game.ts b/site/src/lib/game.ts index d1adef7..9d906c5 100644 --- a/site/src/lib/game.ts +++ b/site/src/lib/game.ts @@ -15,7 +15,7 @@ export interface Game { | "Lens" | "Cig" | "Beer" | "Cuff" | "Knife" | "DealerConcedes" | "ChallengerConcedes" /** - * Round winner. + * Match winner. */ winner?: 0 | 1 | null /**