aboutsummaryrefslogtreecommitdiff
path: root/go/client
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-30 20:25:15 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:33 +0200
commit84d69cf805e1b998768a5a340f0388cf68307ff2 (patch)
treec6578326dafade6fd00ccdee525af288f140fe8f /go/client
parent81e9ab9db504e09e24523482b169726a25d9a3b1 (diff)
downloadmuhqs-game-84d69cf805e1b998768a5a340f0388cf68307ff2.tar.gz
muhqs-game-84d69cf805e1b998768a5a340f0388cf68307ff2.zip
use any instead of interface{}
Diffstat (limited to 'go/client')
-rw-r--r--go/client/game.go10
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