only report match winners
This commit is contained in:
parent
016d297f10
commit
9a02235eba
@ -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]:
|
||||||
|
@ -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"`
|
||||||
|
@ -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
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user