From 5a4a5159b3dcc1caa01e81222f3f1beefcfb4b02 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 30 Jul 2025 20:25:15 +0200 Subject: use any instead of interface{} --- go/client/game.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'go/client') diff --git a/go/client/game.go b/go/client/game.go index fdb72683..13209695 100644 --- a/go/client/game.go +++ b/go/client/game.go @@ -37,7 +37,7 @@ type Game struct { keyBindings keyBindings - selectedObject interface{} + selectedObject any handLayer *ui.HandView stateBar *ui.StateBar @@ -377,7 +377,7 @@ func (g *Game) addTriggers(actions []*game.TriggeredAction) { g.triggers = actions } -func (g *Game) addHighlight(obj interface{}, color color.Color) { +func (g *Game) addHighlight(obj any, color color.Color) { switch obj := obj.(type) { case ui.HandCard: g.handLayer.AddHighlightCard(obj.C, color) @@ -392,7 +392,7 @@ func (g *Game) addHighlight(obj interface{}, color color.Color) { } } -func (g *Game) addHighlights(objs []interface{}, color color.Color) { +func (g *Game) addHighlights(objs []any, color color.Color) { for _, obj := range objs { g.addHighlight(obj, color) } @@ -538,7 +538,7 @@ func (g *Game) handlePlayerNotifications() { } } -func (g *Game) findObjectAt(x, y int) interface{} { +func (g *Game) findObjectAt(x, y int) any { // Iterate the widget in reverse order to ensure that objects are found // in the newer widget possibly drawn over older ones widgets := g.Widgets() @@ -565,7 +565,7 @@ func (g *Game) progressPlayAction(a *game.PlayAction) { } } -func (g *Game) handleSelection(obj interface{}, x, y int) { +func (g *Game) handleSelection(obj any, x, y int) { if obj == nil { log.Printf("No object found at cursor position (%d, %d)\n", x, y) return -- cgit v1.2.3