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.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/go/game/state.go b/go/game/state.go
index 1c773618..d5a9bfc6 100644
--- a/go/game/state.go
+++ b/go/game/state.go
@@ -51,6 +51,7 @@ func (s *LocalState) Players() []*Player {
return s.players
}
+// PlayerById returns the player using its 1-based identifier.
func (s *LocalState) PlayerById(id int) *Player {
return s.players[id-1]
}
@@ -457,6 +458,7 @@ func (s *LocalState) declareAction(a Action) {
if err == nil {
t := a.Targets()
if t != nil {
+ // FIXME: seperate between targets choices implemented as target
s.events = append(s.events, newTargetEvent(a, t))
}
}
@@ -524,6 +526,8 @@ func (s *LocalState) allPassing(skipFirst bool) bool {
switch a := _a.(type) {
case *PassPriority:
log.Printf("%s passed %d/%d\n", p.Name, i+1, nPlayers)
+ case nil:
+ log.Fatal("received nil action from ", p.Name, " at ", s.activePhase)
default:
s.declareAction(a)
return false