From 73d40903aecad3efcf7c6055c133f0db86558203 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 24 Jan 2023 00:27:50 +0100 Subject: intermediate commit --- go/game/stack.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'go/game/stack.go') 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() + } } -- cgit v1.2.3