aboutsummaryrefslogtreecommitdiff
path: root/go/game/stack.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/stack.go')
-rw-r--r--go/game/stack.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/go/game/stack.go b/go/game/stack.go
index a4ba6a49..62783bf2 100644
--- a/go/game/stack.go
+++ b/go/game/stack.go
@@ -45,11 +45,22 @@ func (s *Stack) pop() {
}
}
-func (s *Stack) resolve() {
+func (s *Stack) resolve() []*Player {
for !s.IsEmpty() {
- for !s.gameState.allPassing(false) {
+ for {
+ passing, w := s.gameState.allPassing(false)
+ if len(w) > 0 {
+ return w
+ }
+ if passing {
+ break
+ }
}
s.pop()
- s.gameState.stateBasedActions()
+ w := s.gameState.stateBasedActions()
+ if len(w) > 0 {
+ return w
+ }
}
+ return nil
}