]> git.scottworley.com Git - planeteer/blobdiff - planeteer.go
Some safety against future modifications in DimensionSizes().
[planeteer] / planeteer.go
index 5acf98fd87b3179ec9e1638c7096052f6229dbef..314a3b62e62c18a4a8a7f259c33df374ffe6214b 100644 (file)
@@ -142,6 +142,13 @@ func DimensionSizes(data planet_data) []int {
        dims[NeedFighters] = bint(*drones > 0) + 1
        dims[NeedShields] = bint(*batteries > 0) + 1
        dims[Visit] = 1 << uint(len(visit()))
+
+       // Remind myself to add a line above when adding new dimensions
+       for i, dim := range dims {
+               if dim < 1 {
+                       panic(i)
+               }
+       }
        return dims
 }