aboutsummaryrefslogtreecommitdiff
path: root/go/game/state.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-08-17 15:22:52 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-19 15:41:15 +0200
commita8d818be7dbd6fbcd4e2ad484337c5f275575f41 (patch)
treedbb65983d3cc6b4d63f8b70d02ad68aca85e023a /go/game/state.go
parent8d85a5019d12644588e7ac112556055e7e54c266 (diff)
downloadmuhqs-game-a8d818be7dbd6fbcd4e2ad484337c5f275575f41.tar.gz
muhqs-game-a8d818be7dbd6fbcd4e2ad484337c5f275575f41.zip
add more events
Diffstat (limited to 'go/game/state.go')
-rw-r--r--go/game/state.go5
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))