From 2bc941c548c7249fe122fbdf43963b798cb2b14f Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 6 Jun 2025 21:04:09 -0500 Subject: make PlayerControl a Closer --- go/game/playerControl.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'go/game/playerControl.go') 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) -- cgit v1.2.3