diff options
Diffstat (limited to 'go/game/playerControl.go')
| -rw-r--r-- | go/game/playerControl.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/go/game/playerControl.go b/go/game/playerControl.go index bad1a13a..c472f4f0 100644 --- a/go/game/playerControl.go +++ b/go/game/playerControl.go @@ -42,7 +42,7 @@ func (n PlayerNotification) IsPriorityNotification() bool { type PlayerNotification struct { Notification PlayerNotificationType - Context interface{} + Context any Error error } @@ -104,6 +104,7 @@ type PlayerControl interface { Player() *Player RecvAction() Action SendNotification(PlayerNotification) + Close() } type ChanPlayerControl struct { @@ -124,6 +125,10 @@ func (c *ChanPlayerControl) RecvNotification() *PlayerNotification { return nil } } +func (c *ChanPlayerControl) Close() { + close(c.actions) + close(c.notifications) +} func NewChanPlayerControl(p *Player) *ChanPlayerControl { a := make(chan Action) |
