This commit is contained in:
Pavel Flegr 2026-05-07 18:41:12 +02:00
commit ef045f9353
4 changed files with 76 additions and 108 deletions

View file

@ -531,18 +531,24 @@ func (g *Game) buildState(p *Player, chosenSuit Suit) GameScriptState {
copy(handCopy, p.Hand)
counts := make([]int, len(g.Players))
hands := make([][]Card, len(g.Players))
for i, pl := range g.Players {
counts[i] = len(pl.Hand)
h := make([]Card, len(pl.Hand))
copy(h, pl.Hand)
hands[i] = h
}
return GameScriptState{
ActiveSuit: g.ActiveSuit,
PenaltyCards: g.PenaltyCards,
SkipNext: g.SkipNext,
ChosenSuit: chosenSuit,
Hand: handCopy,
PlayerCount: len(g.Players),
HandCounts: counts,
Direction: g.Direction,
ActiveSuit: g.ActiveSuit,
PenaltyCards: g.PenaltyCards,
SkipNext: g.SkipNext,
ChosenSuit: chosenSuit,
Hand: handCopy,
PlayerHands: hands,
CurrentPlayerIndex: g.CurrentPlayer,
PlayerCount: len(g.Players),
HandCounts: counts,
Direction: g.Direction,
}
}