fix: rule game for kot and hakem kot
This commit is contained in:
@@ -45,8 +45,9 @@ type TrickCard struct {
|
||||
// HandResult نتیجه یک هَند.
|
||||
type HandResult struct {
|
||||
WinnerTeam int `json:"winner_team"`
|
||||
Kot bool `json:"kot"` // کُت: تیم بازنده هیچ دستی نبرد
|
||||
Points int `json:"points"` // امتیاز این هَند (۱ معمولی، ۲ کُت)
|
||||
Kot bool `json:"kot"` // کُت: تیم بازنده هیچ دستی نبرد
|
||||
HakemKot bool `json:"hakem_kot"` // حاکمکُت: تیمِ حاکم کُت شد (۳ امتیاز)
|
||||
Points int `json:"points"` // امتیاز این هَند (۱ معمولی، ۲ کُت، ۳ حاکمکُت)
|
||||
NextHakem int `json:"next_hakem"`
|
||||
}
|
||||
|
||||
@@ -269,6 +270,11 @@ func (g *Game) checkHandOver() {
|
||||
points := 1
|
||||
if kot {
|
||||
points = 2
|
||||
// حاکمکُت: اگر تیمِ بازنده همان تیمِ حاکم باشد (حاکم صفر دست برده)،
|
||||
// کُت سنگینتر است ⇒ ۳ امتیاز.
|
||||
if Team(g.Hakem) == loserTeam {
|
||||
points = 3
|
||||
}
|
||||
}
|
||||
g.Scores[winnerTeam] += points
|
||||
|
||||
@@ -281,6 +287,7 @@ func (g *Game) checkHandOver() {
|
||||
g.LastResult = &HandResult{
|
||||
WinnerTeam: winnerTeam,
|
||||
Kot: kot,
|
||||
HakemKot: points == 3,
|
||||
Points: points,
|
||||
NextHakem: nextHakem,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user