only report match winners

This commit is contained in:
Branden J Brown 2024-02-03 12:54:19 -06:00
parent 016d297f10
commit 9a02235eba
3 changed files with 3 additions and 3 deletions

View File

@ -240,7 +240,7 @@ func (g *Match) DTO(id player.ID) serve.Game {
blank = len(g.shells) - live blank = len(g.shells) - live
} }
w := serve.NoWinner w := serve.NoWinner
switch g.RoundWinner() { switch g.MatchWinner() {
case &g.players[0]: case &g.players[0]:
w = serve.DealerWins w = serve.DealerWins
case &g.players[1]: case &g.players[1]:

View File

@ -9,7 +9,7 @@ type Game struct {
Players [2]Player `json:"players"` Players [2]Player `json:"players"`
// Action indicates the previous action taken in the game. // Action indicates the previous action taken in the game.
Action string `json:"action"` 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"` Winner Winner `json:"winner,omitempty"`
// Round is the current round. // Round is the current round.
Round int8 `json:"round"` Round int8 `json:"round"`

View File

@ -15,7 +15,7 @@ export interface Game {
| "Lens" | "Cig" | "Beer" | "Cuff" | "Knife" | "Lens" | "Cig" | "Beer" | "Cuff" | "Knife"
| "DealerConcedes" | "ChallengerConcedes" | "DealerConcedes" | "ChallengerConcedes"
/** /**
* Round winner. * Match winner.
*/ */
winner?: 0 | 1 | null winner?: 0 | 1 | null
/** /**