aboutsummaryrefslogtreecommitdiff
path: root/internal/game/core_stations.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/core_stations.go')
-rw-r--r--internal/game/core_stations.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/game/core_stations.go b/internal/game/core_stations.go
new file mode 100644
index 0000000..d30a35c
--- /dev/null
+++ b/internal/game/core_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
+}