asd
This commit is contained in:
parent
e2c4d4cb83
commit
ef045f9353
4 changed files with 76 additions and 108 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue