diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-24 00:27:50 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:44 +0100 |
| commit | 73d40903aecad3efcf7c6055c133f0db86558203 (patch) | |
| tree | e9c8f00fb186e270da92f273f570579f2d0b0d95 /go/game/stack.go | |
| parent | fbba48698d8f8b83dfd7d914b0e37338e0d4e2ef (diff) | |
| download | muhqs-game-73d40903aecad3efcf7c6055c133f0db86558203.tar.gz muhqs-game-73d40903aecad3efcf7c6055c133f0db86558203.zip | |
intermediate commit
Diffstat (limited to 'go/game/stack.go')
| -rw-r--r-- | go/game/stack.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/go/game/stack.go b/go/game/stack.go index 22c20fa3..45ba4072 100644 --- a/go/game/stack.go +++ b/go/game/stack.go @@ -18,6 +18,7 @@ func (s *Stack) IsEmpty() bool { } func (s *Stack) Push(a Action) { + s.gameState.broadcastNotification(NewDeclaredActionNotification(a)) s.Actions = append(s.Actions, a) } @@ -29,4 +30,13 @@ func (s *Stack) Pop() { a := s.Actions[l-1] s.Actions = s.Actions[:l-1] a.Resolve(s.gameState) + s.gameState.broadcastNotification(NewResolvedActionNotification(a)) +} + +func (s *Stack) Resolve() { + for !s.IsEmpty() { + log.Println("Resolve Stack") + s.gameState.AllPassing() + s.Pop() + } } |
