diff options
| author | historia <[not public]> | 2026-06-17 21:13:07 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-17 21:13:07 -0400 |
| commit | ec2e94e3463654a6288464a4c070b48ef9bf7368 (patch) | |
| tree | 3c5df0f9a6a5968fa4c725a7d331825883ae798c /internal/game/stations.go | |
| parent | eef5ddaa94f8cff6010d092c30fed53d2be01524 (diff) | |
| download | thehouseoficarus-ec2e94e3463654a6288464a4c070b48ef9bf7368.tar.gz | |
feat: smithing added, item/object interaction reworked. recipes and menus refactored.
Diffstat (limited to 'internal/game/stations.go')
| -rw-r--r-- | internal/game/stations.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/game/stations.go b/internal/game/stations.go new file mode 100644 index 0000000..d30a35c --- /dev/null +++ b/internal/game/stations.go @@ -0,0 +1,28 @@ +package game + +func (g *Game) findStation(roomID int, stationIDs []string) (defID string, displayName string) { + for _, obj := range g.World.AllObjInstances(roomID) { + if obj.Depleted { + continue + } + for _, sid := range stationIDs { + if obj.DefID == sid { + name := sid + if def, err := g.ObjectStore.Load(sid); err == nil { + name = def.Name + } + return sid, name + } + } + } + return "", "" +} + +func stationMatch(defID string, recipeStations []string) bool { + for _, rs := range recipeStations { + if rs == defID { + return true + } + } + return false +} |
