From abd612c15799f604e671e83dc7c410ed2b44185f Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Thu, 25 Jun 2026 15:40:48 -0400 Subject: slop refactor --- internal/game/action_default_target.go | 61 ---------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 internal/game/action_default_target.go (limited to 'internal/game/action_default_target.go') diff --git a/internal/game/action_default_target.go b/internal/game/action_default_target.go deleted file mode 100644 index a184f32..0000000 --- a/internal/game/action_default_target.go +++ /dev/null @@ -1,61 +0,0 @@ -package game - -import ( - "strings" -) - -func verbToSkill(verb string) string { - return verbSkill[verb] -} - -func (g *Game) defaultTarget(roomID int, verb string) string { - skill := verbToSkill(verb) - if skill == "" { - return "" - } - - objStates := g.World.AllObjInstances(roomID) - - type candidate struct { - defID string - name string - } - var candidates []candidate - seen := make(map[string]bool) - - for _, st := range objStates { - if seen[st.DefID] { - continue - } - seen[st.DefID] = true - - objDef, err := g.ObjectStore.Load(st.DefID) - if err != nil || !objDef.IsGatherable() { - continue - } - - if strings.EqualFold(objDef.Gather.Skill, skill) { - candidates = append(candidates, candidate{defID: st.DefID, name: objDef.Name}) - } - } - - if len(candidates) == 1 { - return candidates[0].name - } - return "" -} - -func (g *Game) resolveDefaultMob(roomID int) string { - mobs := g.MobStore.MobsInRoom(roomID) - if len(mobs) == 0 { - return "" - } - - firstDef := mobs[0].DefID - for _, m := range mobs[1:] { - if m.DefID != firstDef { - return "" - } - } - return mobs[0].Name -} -- cgit v1.2.3