aboutsummaryrefslogtreecommitdiff
path: root/internal/game/action_clean.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_clean.go
parent15b7e221b799ef107dec44ecdb294026dfd3d059 (diff)
downloadthehouseoficarus-94a06fbbe682701ca4d4bd2a70cd74d8df29c932.tar.gz
refactor: replaced map[string]any with typed structs for Data
Diffstat (limited to 'internal/game/action_clean.go')
-rw-r--r--internal/game/action_clean.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/game/action_clean.go b/internal/game/action_clean.go
index 751ac34..d41746e 100644
--- a/internal/game/action_clean.go
+++ b/internal/game/action_clean.go
@@ -3,6 +3,7 @@ package game
import (
"strings"
+ "thehouseoficarus/internal/action"
"thehouseoficarus/internal/engine"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/object"
@@ -10,11 +11,16 @@ import (
)
func (g *Game) advanceClean(sess *net.Session, p *player.Player) {
- phase, _ := p.BackgroundAction.Data["phase"].(int)
- filter, _ := p.BackgroundAction.Data["filter"].(string)
+ data, ok := p.BackgroundAction.Data.(*action.CleanData)
+ if !ok {
+ g.cancelBgAction(p)
+ return
+ }
+ phase := data.Phase
+ filter := data.Filter
if phase == 0 {
- p.BackgroundAction.Data["phase"] = 1
+ data.Phase = 1
p.BackgroundAction.WaitLeft = engine.ToTicks(2)
return
}