implement player loses on move timer expires

Fixes #11.
This commit is contained in:
2024-02-03 22:34:29 -06:00
parent a38bf9631f
commit c7ee3760ba
2 changed files with 9 additions and 1 deletions

View File

@@ -240,6 +240,11 @@ func (g *Match) Concede(id player.ID) error {
return ErrRoundEnded
}
// Expire makes the current player concede.
func (g *Match) Expire() {
g.Concede(g.CurrentPlayer().id)
}
// DTO returns the current match state as viewed by the given player and with
// the given deadline on the current player's next move.
func (g *Match) DTO(id player.ID, deadline time.Time) serve.Game {