Skip to content

Commit

Permalink
Add deck out
Browse files Browse the repository at this point in the history
  • Loading branch information
sindreslungaard committed Nov 9, 2021
1 parent 2f8e6ac commit 05fe387
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions game/match/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ func (p *Player) DrawCards(n int) {
p.match.Chat("Server", fmt.Sprintf("%s drew %v card", p.match.PlayerRef(p).Socket.User.Username, n))
}

if len(p.deck) <= 0 {
// deck out
p.match.End(p.match.Opponent(p), fmt.Sprintf("%s won by deck out!", p.match.Opponent(p).Username()))
}

}

// HasCard checks if a container has a card
Expand Down

0 comments on commit 05fe387

Please sign in to comment.