diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-30 20:25:15 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-07-30 20:28:56 +0200 |
| commit | 5a4a5159b3dcc1caa01e81222f3f1beefcfb4b02 (patch) | |
| tree | 643fa1cdddca1f03d5e76719a2afb607009d91c1 /go/client | |
| parent | f64e8747e287e949ce7cbbb42303ad1cdfabec89 (diff) | |
| download | muhqs-game-5a4a5159b3dcc1caa01e81222f3f1beefcfb4b02.tar.gz muhqs-game-5a4a5159b3dcc1caa01e81222f3f1beefcfb4b02.zip | |
use any instead of interface{}
Diffstat (limited to 'go/client')
| -rw-r--r-- | go/client/game.go | 10 |
1 files changed, 5 insertions, 5 deletions
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 |
