diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-08-17 15:22:52 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:39 +0200 |
| commit | a30839fcdff7585e2b36edf29f7b2230c1923f30 (patch) | |
| tree | f20013934ebfd4eedec71b6b28dcbafa1a720f27 /go/game/state.go | |
| parent | 9463ec4cb063f0bde03d0e1b2a650f5887ad29ff (diff) | |
| download | muhqs-game-a30839fcdff7585e2b36edf29f7b2230c1923f30.tar.gz muhqs-game-a30839fcdff7585e2b36edf29f7b2230c1923f30.zip | |
add more events
Diffstat (limited to 'go/game/state.go')
| -rw-r--r-- | go/game/state.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/go/game/state.go b/go/game/state.go index 0d8066c0..c0b3ed37 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -168,7 +168,9 @@ func (s *LocalState) Loop() []*Player { p.Turn++ if p.Deck.IsEmpty() { - log.Printf("Shuffle %s pile into the deck\n", p.Name) + e := newShuffleEvent(p, []PileOfCards{p.DiscardPile}) + s.fireEvent(e) + p.DiscardPile.MoveInto(p.Deck) p.Deck.Shuffle(s.Rand) } @@ -464,6 +466,7 @@ func (s *LocalState) declareAction(a Action) { if err == nil { s.pushAction(a) + s.fireEvent(newDeclaredActionEvent(a)) } s.broadcastNotification(newDeclaredActionNotification(a, err)) |
