diff options
Diffstat (limited to 'go/game/player.go')
| -rw-r--r-- | go/game/player.go | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/go/game/player.go b/go/game/player.go index a3b5c44b..a8372040 100644 --- a/go/game/player.go +++ b/go/game/player.go @@ -198,14 +198,24 @@ func (p *Player) buyPhase() []*Player { return nil } -func (p *Player) discardHand() { - for _, c := range p.Hand.Cards() { - p.DiscardCard(c) +func (p *Player) _discardCard(c *Card) { + p.Hand.MoveCard(c, p.DiscardPile) +} + +func (p *Player) discardCard(c *Card) { + p._discardCard(c) + p.gameState.fireEvent(Event{discard, []any{p}, []any{c}}) +} + +func (p *Player) discardCards(cards []*Card) { + for _, c := range cards { + p._discardCard(c) } + p.gameState.fireEvent(Event{discard, []any{p}, utils.TypedSliceToInterfaceSlice(cards)}) } -func (p *Player) DiscardCard(c *Card) { - p.Hand.MoveCard(c, p.DiscardPile) +func (p *Player) discardHand() { + p.discardCards(p.Hand.Cards()) } func (p *Player) discardStep() { |
