+func PlanetIndex(data planet_data, name string) int {
+ index, ok := data.p2i[name]
+ if !ok {
+ panic("Unknown planet " + name)
+ }
+ return index
+}
+
+func CommodityIndex(data planet_data, name string) int {
+ index, ok := data.c2i[name]
+ if !ok {
+ panic("Unknown commodity " + name)
+ }
+ return index
+}
+