aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_identify.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-25 00:44:47 -0400
committerhistoria <[not public]>2026-06-25 00:44:47 -0400
commit94a06fbbe682701ca4d4bd2a70cd74d8df29c932 (patch)
treeeb49fb1893e61092138164d419e863ee3fe0d1e2 /internal/game/action_identify.go
parent15b7e221b799ef107dec44ecdb294026dfd3d059 (diff)
downloadthehouseoficarus-94a06fbbe682701ca4d4bd2a70cd74d8df29c932.tar.gz
refactor: replaced map[string]any with typed structs for Data
Diffstat (limited to 'internal/game/action_identify.go')
-rw-r--r--internal/game/action_identify.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/game/action_identify.go b/internal/game/action_identify.go
index 8b60b13..401ab94 100644
--- a/internal/game/action_identify.go
+++ b/internal/game/action_identify.go
@@ -3,13 +3,19 @@ package game
import (
"fmt"
+ "thehouseoficarus/internal/action"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
)
func (g *Game) advanceIdentify(sess *net.Session, p *player.Player) {
- junkID := p.Action.Data["junk_id"].(string)
- xpPer := p.Action.Data["xp_per"].(int)
+ data, ok := p.Action.Data.(*action.IdentifyData)
+ if !ok {
+ g.cancelAction(p)
+ return
+ }
+ junkID := data.JunkID
+ xpPer := data.XPPer
scrapCount := p.CountItem("scrap")
if scrapCount == 0 {