aboutsummaryrefslogtreecommitdiff
path: root/go/game/state.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/state.go')
-rw-r--r--go/game/state.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/go/game/state.go b/go/game/state.go
index 6fa8b4c3..25385f31 100644
--- a/go/game/state.go
+++ b/go/game/state.go
@@ -468,14 +468,19 @@ func (s *LocalState) orderTriggeredActions(triggeredActions []*TriggeredAction)
orderedActions := []Action{}
nPlayers := len(s.players)
- for i := 0; i < nPlayers; i++ {
+ for i := range nPlayers {
p := s.players[(i+s.activePlayerId-1)%nPlayers]
actions := playerActions[p]
pActions := make([]Action, 0, len(actions))
p.Ctrl.SendNotification(newDeclareTriggeredActionsPrompt(actions))
- switch a := p.Ctrl.RecvAction().(type) {
+ _a, err := p.Ctrl.RecvAction()
+ if err != nil {
+ // FIXME
+ }
+
+ switch a := _a.(type) {
case *DeclareTriggeredActionsAction:
for _, a := range a.actions { // Use the order passed back by the user
pActions = append(pActions, a)
@@ -504,8 +509,12 @@ func (s *LocalState) allPassing(skipFirst bool) bool {
p := s.players[(i+s.activePlayerId-1)%nPlayers]
s.stateBasedActions()
p.Ctrl.SendNotification(newPriorityNotification())
- a := p.Ctrl.RecvAction()
- switch a.(type) {
+ _a, err := p.Ctrl.RecvAction()
+ if err != nil {
+ // FIXME
+ }
+
+ switch a := _a.(type) {
case *PassPriority:
log.Printf("%s passed %d/%d\n", p.Name, i+1, nPlayers)
default: