diff options
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() + } } |
